index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/nit-picker | 26 |
diff --git a/bin/nit-picker b/bin/nit-picker index 50524e9..87c7b92 100755 --- a/bin/nit-picker +++ b/bin/nit-picker @@ -87,6 +87,7 @@ while pgrep -x ii >/dev/null \ printf 'SELECT DISTINCT' printf ' "commit",' printf '`git_repositories`.`name`,' + printf '`git_repositories`.`head`,' printf '`package_sources`.`git_revision`' printf ' FROM `package_sources`' mysql_join_package_sources_upstream_repositories @@ -96,6 +97,9 @@ while pgrep -x ii >/dev/null \ printf 'SELECT DISTINCT' printf ' "commit",' printf '"archlinux32",' + # shellcheck disable=SC2154 + printf '"%s",' \ + "${repo_heads__archlinux32}" printf '`package_sources`.`mod_git_revision`' printf ' FROM `package_sources`' printf ';\n' @@ -121,6 +125,8 @@ while pgrep -x ii >/dev/null \ 'commit') # check whether a given commit is present in the git repo git_repo="${parameters%% *}" git_rev="${parameters#${git_repo} }" + git_head="${parameters%% *}" + git_rev="${git_rev#${git_head} }" eval "$( printf 'git_dir="${repo_paths__%s}"\n' \ "${git_repo}" @@ -137,6 +143,26 @@ while pgrep -x ii >/dev/null \ | irc_say fi fi + # shellcheck disable=SC2154 + if ! git -C "${git_dir}" cat-file -t "${git_head}" 2> /dev/null | \ + grep -qxF 'commit'; then + git -C "${git_dir}" fetch --all -p >/dev/null 2>&1 + if ! git -C "${git_dir}" cat-file -t "${git_head}" 2> /dev/null | \ + grep -qxF 'commit'; then + printf 'commit %s is missing from repository %s\n' \ + "${git_head}" \ + "${git_repo}" \ + | irc_say + fi + fi + # shellcheck disable=SC2154 + if ! git -C "${git_dir}" merge-base --is-ancestor "${git_rev}" "${git_head}" 2> /dev/null; then + printf 'commit %s is not an ancestor of HEAD %s in repository %s\n' \ + "${git_rev}" \ + "${git_head}" \ + "${git_repo}" \ + | irc_say + fi ;; 'binary-dependencies') ${master_mirror_rsync_command} \ |