From 9e4ce68f5479ec266ab814b7ab7f379808bd2406 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Thu, 8 Jun 2017 08:47:49 +0200 Subject: bin/get-package-updates: option --no-pull new --- bin/get-package-updates | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'bin/get-package-updates') diff --git a/bin/get-package-updates b/bin/get-package-updates index 4ca3679..7a565d2 100755 --- a/bin/get-package-updates +++ b/bin/get-package-updates @@ -16,20 +16,23 @@ usage() { >&2 echo ' and build a list in the proper build order' >&2 echo '' >&2 echo 'possible options:' - >&2 echo ' -b|--block: If necessary, wait for lock blocking.' - >&2 echo ' -h|--help: Show this help and exit.' + >&2 echo ' -b|--block: If necessary, wait for lock blocking.' + >&2 echo ' -h|--help: Show this help and exit.' + >&2 echo ' -n|--no-pull: Do not pull git repos, merely reorder build list.' [ -z "$1" ] && exit 1 || exit $1 } eval set -- "$( - getopt -o bh \ + getopt -o bhn \ --long block \ --long help \ + --long no-pull \ -n "$(basename "$0")" -- "$@" || \ echo usage )" block_flag='-n' +pull=true while true do @@ -40,6 +43,9 @@ do -h|--help) usage 0 ;; + -n|--no-pull) + pull=false + ;; --) shift break @@ -73,7 +79,9 @@ for repo in "${repo_paths[@]}"; do git -C "${repo}" checkout -f master git -C "${repo}" clean -xdf git -C "${repo}" fetch - git -C "${repo}" reset --hard origin/master + if ${pull}; then + git -C "${repo}" reset --hard origin/master + fi done # Read previous git revision numbers from files. -- cgit v1.2.3-54-g00ecf