index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
-rwxr-xr-x | bin/get-package-updates | 22 |
diff --git a/bin/get-package-updates b/bin/get-package-updates index d791453..ae3c018 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -22,6 +22,9 @@ usage() { >&2 echo ' -h|--help: Show this help and exit.' >&2 echo ' -i|--ignore-insanity:' >&2 echo ' Do not abort when insane.' + >&2 echo ' -m|--max-upstream-packages $number:' + >&2 echo ' Do not update more than $number upstream packages.' + >&2 echo ' Do not update git head of state repository.' >&2 echo ' -n|--no-pull: Do not pull git repos, merely reorder build list.' >&2 echo ' Conflicts -d.' >&2 echo ' -r|--recent-modifications:' @@ -33,10 +36,11 @@ usage() { } eval set -- "$( - getopt -o d:hinrw \ + getopt -o d:him:nrw \ --long date: \ --long help \ --long ignore-insanity \ + --long max-upstream-packages: \ --long no-pull \ --long recent-modifications \ --long wait \ @@ -47,6 +51,7 @@ eval set -- "$( block_flag='-n' date_time='' ignore_insanity=false +max_upstream_packages='' pull=true recent_modifications=false @@ -63,6 +68,10 @@ do -i|--ignore-insanity) ignore_insanity=true ;; + -m|--max-upstream-packages) + shift + max_upstream_packages="$1" + ;; -n|--no-pull) pull=false ;; @@ -355,7 +364,12 @@ echo 'Check modified packages from the last update, and put them to the build li mod_git_revision='0000000000000000000000000000000000000000' fi printf '%s %s %s %s\n' "${pkgbase}" "${repository}" "${git_revision}" "${mod_git_revision}" - done + done \ + | if [ -n "${max_upstream_packages}" ]; then + head -n"${max_upstream_packages}" + else + cat + fi # shellcheck disable=SC2154 git -C "${repo_paths__archlinux32}" diff "${old_repo_revisions__archlinux32}" "${new_repo_revisions__archlinux32}" --name-status \ | tr '\t/' ' ' \ @@ -508,6 +522,10 @@ echo 'Done - mark decisions as final.' # update hashes of repositories in mysql database for repo in ${repo_names}; do + if [ -n "${max_upstream_packages}" ] \ + && [ "${repo}" = 'state' ]; then + continue + fi printf 'UPDATE `git_repositories`' printf ' SET `git_repositories`.`head`=from_base64("%s")' \ "$(eval 'printf '"'"'%s'"'"' "${new_repo_revisions__'"${repo}"'}"' | base64 -w0)" |