]> TLD Linux GIT Repositories - packages/rpm-build-tools.git/blobdiff - kde4send2builders.sh
- add -s, --skip-pull option to skip git pull when you're sure that the repo is alrea...
[packages/rpm-build-tools.git] / kde4send2builders.sh
index 4b5cbf15c74aeafa64f4b41afd3ab1edac1df94b..eb4f78f11cf5d6b1275750cfc6e58f331614a1a3 100755 (executable)
@@ -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
@@ -177,7 +185,14 @@ fi
 if [ "$ATAG" == "yes" ]; then
        for spec in $specs; do
                PKG=$(echo $spec |sed -e 's/.spec//g')
-               LAST_AUTOTAG=$(cd $SPECDIR/packages && ksh ./builder -g -ns $PKG/$spec >/dev/null 2>&1 && cvs status -v $PKG/$spec | awk -vdist=$disttag '!/Sticky/ && $1 ~ "^auto-" dist "-"{if (!a++) print $1}')
+               if [ ! -d $PKG ]; then
+                       git clone git@git.tld-linux.org:packages/${PKG}
+               fi
+               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