From d149169bd80f434657a6a13d2104ac3d879ed095 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20=C5=9Awi=C4=85tek?= Date: Tue, 10 Jul 2012 17:39:53 +0200 Subject: [PATCH] - add -s, --skip-pull option to skip git pull when you're sure that the repo is already up-to-date (is a little faster) --- kde4send2builders.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/kde4send2builders.sh b/kde4send2builders.sh index 04c68da..eb4f78f 100755 --- a/kde4send2builders.sh +++ b/kde4send2builders.sh @@ -16,6 +16,8 @@ usage() { echo " -b --builder VALUE" echo " choose a particular builder, default all" echo " -p --priority VALUE (default: 2)" + echo " -s --skip-pull (default: no)" + echo " skip git pull when getting autotag" echo " -h --help" echo " show this help" echo "" @@ -38,6 +40,7 @@ ATAG=no SENDPRIO= BUILDER= PRIO=2 +SKIPPULL=0 #SPECDIR=$(rpm -E %_specdir) SPECDIR=~/rpm @@ -120,6 +123,11 @@ while [ $# -gt 0 ]; do PRIO=$2 shift ;; + + --skip-pull | -s ) + SKIPPULL=1 + shift + ;; --help | -h ) usage @@ -180,7 +188,11 @@ if [ "$ATAG" == "yes" ]; then if [ ! -d $PKG ]; then git clone git@git.tld-linux.org:packages/${PKG} fi - LAST_AUTOTAG=$(cd $PKG && git pull >/dev/null && git tag |tail -n 1) + if [ $SKIPPULL -lt 1 ]; then + LAST_AUTOTAG=$(cd $PKG && git pull >/dev/null && git tag |tail -n 1) + else + LAST_AUTOTAG=$(cd $PKG && git tag |tail -n 1) + fi sleep 1 SENDPRIO="$SENDPRIO $spec:$LAST_AUTOTAG " done -- 2.44.0