summaryrefslogtreecommitdiffstats
path: root/security/nss/fuzz/config/git-copy.sh
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:46:26 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-06 11:46:26 +0100
commitf017b749ea9f1586d2308504553d40bf4cc5439d (patch)
treec6033924a0de9be1ab140596e305898c651bf57e /security/nss/fuzz/config/git-copy.sh
parent7c728b3c7680662fc4e92b5d03697b8339560b08 (diff)
downloadUXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.gz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.lz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.tar.xz
UXP-f017b749ea9f1586d2308504553d40bf4cc5439d.zip
Update NSS to 3.32.1-RTM
Diffstat (limited to 'security/nss/fuzz/config/git-copy.sh')
-rw-r--r--security/nss/fuzz/config/git-copy.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/security/nss/fuzz/config/git-copy.sh b/security/nss/fuzz/config/git-copy.sh
new file mode 100644
index 000000000..a5c7d371d
--- /dev/null
+++ b/security/nss/fuzz/config/git-copy.sh
@@ -0,0 +1,33 @@
+#!/usr/bin/env bash
+
+set -e
+
+if [ $# -lt 3 ]; then
+ echo "Usage: $0 <repo> <branch> <directory>" 1>&2
+ exit 2
+fi
+
+REPO=$1
+COMMIT=$2
+DIR=$3
+
+echo "Copy '$COMMIT' from '$REPO' to '$DIR'"
+if [ -f $DIR/.git-copy ]; then
+ CURRENT=$(cat $DIR/.git-copy)
+ if [ $(echo -n $COMMIT | wc -c) != "40" ]; then
+ # On the off chance that $COMMIT is a remote head.
+ ACTUAL=$(git ls-remote $REPO $COMMIT | cut -c 1-40 -)
+ else
+ ACTUAL=$COMMIT
+ fi
+ if [ "$CURRENT" = "$ACTUAL" ]; then
+ echo "Up to date."
+ exit
+ fi
+fi
+
+git init -q $DIR
+git -C $DIR fetch -q --depth=1 $REPO $COMMIT:git-copy-tmp
+git -C $DIR reset --hard git-copy-tmp
+git -C $DIR rev-parse --verify HEAD > $DIR/.git-copy
+rm -rf $DIR/.git