index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-05-01 22:59:08 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-05-01 22:59:08 +0200 |
commit | ed62e2cb3798bd8f587b027c5eefc09d5ce7dbdb (patch) | |
tree | e508fa2ef1ac44947b4f98c5cdaefd42a9f9947d | |
parent | 35efee7d4caa708b0971df9a4c2c8da092b93a7a (diff) |
-rwxr-xr-x | bin/get-package-updates | 29 |
diff --git a/bin/get-package-updates b/bin/get-package-updates index 56addd7..d18ebe2 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -22,8 +22,12 @@ usage() { >&2 echo '' >&2 echo 'possible options:' >&2 echo ' -b|--block: If necessary, wait for lock blocking.' + >&2 echo ' -d|--date $datetime:' + >&2 echo ' Pull latest commit before $datetime' + >&2 echo ' (yyyy-mm-ddThh:mm:ss). Conflicts -n.' >&2 echo ' -h|--help: Show this help and exit.' >&2 echo ' -n|--no-pull: Do not pull git repos, merely reorder build list.' + >&2 echo ' Conflicts -d.' >&2 echo ' -x|--test-exclusion $package:' >&2 echo ' Print additionally deleted/excluded packages if' >&2 echo ' "$package" would be black listed.' @@ -31,8 +35,9 @@ usage() { } eval set -- "$( - getopt -o bhnx: \ + getopt -o bd:hnx: \ --long block \ + --long date: \ --long help \ --long no-pull \ --long test-exclusion: \ @@ -41,6 +46,7 @@ eval set -- "$( )" block_flag='-n' +date_time='' test_exclusion='' pull=true @@ -50,6 +56,10 @@ do -b|--block) block_flag='' ;; + -d|--date) + shift + date_time="$1" + ;; -h|--help) usage 0 ;; @@ -82,6 +92,11 @@ if [ $# -ne 0 ]; then usage fi +if [ -n "${date_time}" ] && ! ${pull}; then + >&2 printf -- '-d and -n are mutually exclusive.\n' + usage +fi + if [ -s "${work_dir}/build-master-sanity" ]; then >&2 echo 'Build master is not sane.' exit @@ -143,9 +158,15 @@ for repo in ${repo_names}; do )'" # determine new git revision if ${pull}; then - eval "new_repo_revisions__${repo}='$( - git -C "${repo_path}" rev-parse HEAD - )'" + if [ -z "${date_time}" ]; then + eval "new_repo_revisions__${repo}='$( + git -C "${repo_path}" rev-parse HEAD + )'" + else + eval "new_repo_revisions__${repo}='$( + git -C "${repo_path}" rev-list -n1 --until "${date_time}" HEAD + )'" + fi else eval 'new_repo_revisions__'"${repo}"'="${old_repo_revisions__'"${repo}"'}"' fi |