diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /security/nss/fuzz/git-copy.sh | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'security/nss/fuzz/git-copy.sh')
-rwxr-xr-x | security/nss/fuzz/git-copy.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/security/nss/fuzz/git-copy.sh b/security/nss/fuzz/git-copy.sh new file mode 100755 index 000000000..1389ddabd --- /dev/null +++ b/security/nss/fuzz/git-copy.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +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 + ACTUAL=$(git ls-remote $REPO $COMMIT | cut -c 1-40 -) + else + ACTUAL=$COMMIT + fi + if [ CURRENT = ACTUAL ]; then + echo "Up to date." + fi +fi + +mkdir -p $DIR +git -C $DIR init -q +git -C $DIR fetch -q --depth=1 $REPO $COMMIT:git-copy-tmp +git -C $DIR reset --hard git-copy-tmp +git -C $DIR show-ref HEAD | cut -c 1-40 - > $DIR/.git-copy +rm -rf $DIR/.git |