summaryrefslogtreecommitdiff
path: root/automation/taskcluster/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'automation/taskcluster/scripts')
-rwxr-xr-xautomation/taskcluster/scripts/build.sh10
-rw-r--r--automation/taskcluster/scripts/tools.sh13
2 files changed, 17 insertions, 6 deletions
diff --git a/automation/taskcluster/scripts/build.sh b/automation/taskcluster/scripts/build.sh
index f48cb20dc..a6a202164 100755
--- a/automation/taskcluster/scripts/build.sh
+++ b/automation/taskcluster/scripts/build.sh
@@ -2,9 +2,9 @@
set -v -e -x
-if [ $(id -u) = 0 ]; then
- source $(dirname $0)/tools.sh
+source $(dirname $0)/tools.sh
+if [[ $(id -u) -eq 0 ]]; then
# Set compiler.
switch_compilers
@@ -13,12 +13,10 @@ if [ $(id -u) = 0 ]; then
fi
# Clone NSPR if needed.
-if [ ! -d "nspr" ]; then
- hg clone https://hg.mozilla.org/projects/nspr
-fi
+hg_clone https://hg.mozilla.org/projects/nspr nspr default
# Build.
-cd nss && make nss_build_all && cd ..
+make -C nss nss_build_all
# Generate certificates.
NSS_TESTS=cert NSS_CYCLES="standard pkix sharedb" $(dirname $0)/run_tests.sh
diff --git a/automation/taskcluster/scripts/tools.sh b/automation/taskcluster/scripts/tools.sh
index 1c2bf103e..57f45d6be 100644
--- a/automation/taskcluster/scripts/tools.sh
+++ b/automation/taskcluster/scripts/tools.sh
@@ -14,3 +14,16 @@ switch_compilers() {
exit 1
fi
}
+
+# Usage: hg_clone repo dir [revision=@]
+hg_clone() {
+ repo=$1
+ dir=$2
+ rev=${3:-@}
+ for i in 0 2 5; do
+ sleep $i
+ hg clone -r "$rev" "$repo" "$dir" && return
+ rm -rf "$dir"
+ done
+ exit 1
+}