[tor-commits] [tor-browser-bundle/master] Fix issues with tag verification for alternate versions file.
mikeperry at torproject.org
mikeperry at torproject.org
Thu Nov 7 05:45:10 UTC 2013
commit 0a15d499588ad25187e64d851bb1bacb5a436b6f
Author: Mike Perry <mikeperry-git at torproject.org>
Date: Wed Nov 6 20:33:55 2013 -0800
Fix issues with tag verification for alternate versions file.
---
gitian/fetch-inputs.sh | 13 ++++++++++---
gitian/mkbundle-linux.sh | 13 ++++++++++---
gitian/mkbundle-mac.sh | 13 ++++++++++---
gitian/mkbundle-windows.sh | 14 +++++++++++---
gitian/verify-tags.sh | 26 ++++++++++++++------------
5 files changed, 55 insertions(+), 24 deletions(-)
diff --git a/gitian/fetch-inputs.sh b/gitian/fetch-inputs.sh
index 7320c74..7c71772 100755
--- a/gitian/fetch-inputs.sh
+++ b/gitian/fetch-inputs.sh
@@ -18,15 +18,22 @@ WRAPPER_DIR=$(readlink -f "$WRAPPER_DIR")
if [ "$#" = 1 ]; then
INPUTS_DIR="$1"
- . ./versions
+ VERSIONS_FILE=./versions
elif [ "$#" = 2 ]; then
- INPUTS_DIR="$PWD/../../gitian-builder/inputs"
- . $2
+ INPUTS_DIR="$1"
+ VERSIONS_FILE=$2
else
echo >&2 "Usage: $0 [<inputsdir> <versions>]"
exit 1
fi
+if ! [ -e $VERSIONS_FILE ]; then
+ echo >&2 "Error: $VERSIONS_FILE file does not exist"
+ exit 1
+fi
+
+. $VERSIONS_FILE
+
mkdir -p "$INPUTS_DIR"
cd "$INPUTS_DIR"
diff --git a/gitian/mkbundle-linux.sh b/gitian/mkbundle-linux.sh
index 09cbdd4..dc73f96 100755
--- a/gitian/mkbundle-linux.sh
+++ b/gitian/mkbundle-linux.sh
@@ -5,11 +5,18 @@
if [ -z "$1" ];
then
- . ./versions
+ VERSIONS_FILE=./versions
else
- . $1
+ VERSIONS_FILE=$1
fi
+if ! [ -e $VERSIONS_FILE ]; then
+ echo >&2 "Error: $VERSIONS_FILE file does not exist"
+ exit 1
+fi
+
+. $VERSIONS_FILE
+
WRAPPER_DIR=$PWD
GITIAN_DIR=$PWD/../../gitian-builder
DESCRIPTOR_DIR=$PWD/descriptors/
@@ -51,7 +58,7 @@ cd $WRAPPER_DIR
if [ "z$VERIFY_TAGS" = "z1" ];
then
- ./verify-tags.sh $GITIAN_DIR/inputs || exit 1
+ ./verify-tags.sh $GITIAN_DIR/inputs $VERSIONS_FILE || exit 1
# If we're verifying tags, be explicit to gitian that we
# want to build from tags.
NSIS_TAG=refs/tags/$NSIS_TAG
diff --git a/gitian/mkbundle-mac.sh b/gitian/mkbundle-mac.sh
index 97d9535..42eb9ef 100755
--- a/gitian/mkbundle-mac.sh
+++ b/gitian/mkbundle-mac.sh
@@ -5,11 +5,18 @@
if [ -z "$1" ];
then
- . ./versions
+ VERSIONS_FILE=./versions
else
- . $1
+ VERSIONS_FILE=$1
fi
+if ! [ -e $VERSIONS_FILE ]; then
+ echo >&2 "Error: $VERSIONS_FILE file does not exist"
+ exit 1
+fi
+
+. $VERSIONS_FILE
+
WRAPPER_DIR=$PWD
GITIAN_DIR=$PWD/../../gitian-builder
DESCRIPTOR_DIR=$PWD/descriptors/
@@ -51,7 +58,7 @@ cd $WRAPPER_DIR
if [ "z$VERIFY_TAGS" = "z1" ];
then
- ./verify-tags.sh $GITIAN_DIR/inputs || exit 1
+ ./verify-tags.sh $GITIAN_DIR/inputs $VERSIONS_FILE || exit 1
# If we're verifying tags, be explicit to gitian that we
# want to build from tags.
NSIS_TAG=refs/tags/$NSIS_TAG
diff --git a/gitian/mkbundle-windows.sh b/gitian/mkbundle-windows.sh
index a542099..16a1454 100755
--- a/gitian/mkbundle-windows.sh
+++ b/gitian/mkbundle-windows.sh
@@ -5,11 +5,19 @@
if [ -z "$1" ];
then
- . ./versions
+ VERSIONS_FILE=./versions
else
- . $1
+ VERSIONS_FILE=$1
fi
+if ! [ -e $VERSIONS_FILE ]; then
+ echo >&2 "Error: $VERSIONS_FILE file does not exist"
+ exit 1
+fi
+
+. $VERSIONS_FILE
+
+
WRAPPER_DIR=$PWD
GITIAN_DIR=$PWD/../../gitian-builder
DESCRIPTOR_DIR=$PWD/descriptors/
@@ -51,7 +59,7 @@ cd $WRAPPER_DIR
if [ "z$VERIFY_TAGS" = "z1" ];
then
- ./verify-tags.sh $GITIAN_DIR/inputs || exit 1
+ ./verify-tags.sh $GITIAN_DIR/inputs $VERSIONS_FILE || exit 1
# If we're verifying tags, be explicit to gitian that we
# want to build from tags.
NSIS_TAG=refs/tags/$NSIS_TAG
diff --git a/gitian/verify-tags.sh b/gitian/verify-tags.sh
index 9621065..055cac5 100755
--- a/gitian/verify-tags.sh
+++ b/gitian/verify-tags.sh
@@ -4,25 +4,27 @@
set -e
set -u
-if ! [ -e ./versions ]; then
- echo >&2 "Error: ./versions file does not exist"
- exit 1
-fi
-
-. ./versions
-
WRAPPER_DIR=$(dirname "$0")
WRAPPER_DIR=$(readlink -f "$WRAPPER_DIR")
-if [ "$#" -gt 1 ]; then
- echo >&2 "Usage: $0 [<inputsdir>]"
- exit 1
-elif [ "$#" = 1 ]; then
+if [ "$#" = 1 ]; then
+ INPUTS_DIR="$1"
+ VERSIONS_FILE=./versions
+elif [ "$#" = 2 ]; then
INPUTS_DIR="$1"
+ VERSIONS_FILE=$2
else
- INPUTS_DIR="$PWD/../../gitian-builder/inputs"
+ echo >&2 "Usage: $0 [<inputsdir> <versions>]"
+ exit 1
fi
+if ! [ -e $VERSIONS_FILE ]; then
+ echo >&2 "Error: $VERSIONS_FILE file does not exist"
+ exit 1
+fi
+
+. $VERSIONS_FILE
+
cd "$INPUTS_DIR"
CLEANUP=$(tempfile)
More information about the tor-commits
mailing list