[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-browser-bundle/master] Bug 17415: Indicate whether remote was updated or not using exit codes.



commit 258d96190368238b7e6419fa768ffddef2931ac7
Author: Linus Nordberg <linus@xxxxxxxxxxxxxx>
Date:   Fri Oct 23 09:03:12 2015 +0200

    Bug 17415: Indicate whether remote was updated or not using exit codes.
---
 tools/continuous-builds/checkout-tbb.sh |   21 ++++++++++++++++-----
 1 file changed, 16 insertions(+), 5 deletions(-)

diff --git a/tools/continuous-builds/checkout-tbb.sh b/tools/continuous-builds/checkout-tbb.sh
index f8a7929..44264ca 100755
--- a/tools/continuous-builds/checkout-tbb.sh
+++ b/tools/continuous-builds/checkout-tbb.sh
@@ -1,8 +1,19 @@
 #! /bin/sh
 
-BUILDDIR=$1
-[ -z "$BUILDDIR" ] && BUILDDIR=~/usr/src/tor-browser-bundle/gitian
+# Checkout branch $2 (default=master) in directory $1 and update it.
+# Exit 0 if HEAD changed due to the update.
+# Exit 1 if HEAD has not changed.
+# Proposed use:
+# $ checkout-tbb.sh && build-tbb.sh
 
-cd $BUILDDIR || exit 1
-git checkout master
-git pull
+BUILDDIR=$HOME/usr/src/tor-browser-bundle/gitian
+[ -n "$1" ] && BUILDDIR="$1"
+BRANCH=master
+[ -n "$2" ] && BRANCH=$2
+
+cd "$BUILDDIR" || exit 2
+
+HEAD=$(git rev-parse $BRANCH)
+git checkout -q $BRANCH
+git pull -q
+[ $HEAD != $(git rev-parse $BRANCH) ]

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits