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

gk at torproject.org gk at torproject.org
Fri Oct 23 07:31:08 UTC 2015


commit 258d96190368238b7e6419fa768ffddef2931ac7
Author: Linus Nordberg <linus at torproject.org>
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) ]



More information about the tor-commits mailing list