summaryrefslogtreecommitdiffstats
path: root/security/nss/fuzz/config
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-02-06 12:02:47 +0100
committerGitHub <noreply@github.com>2018-02-06 12:02:47 +0100
commit389c60da5e01761f4a11ef539ffa26e4c1b17875 (patch)
treec6033924a0de9be1ab140596e305898c651bf57e /security/nss/fuzz/config
parent7c9b585349c985df0cf6ace83da5dadba8b5c677 (diff)
parentf017b749ea9f1586d2308504553d40bf4cc5439d (diff)
downloadUXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar
UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.gz
UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.lz
UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.tar.xz
UXP-389c60da5e01761f4a11ef539ffa26e4c1b17875.zip
Merge pull request #13 from MoonchildProductions/ported-upstream
Ported upstream
Diffstat (limited to 'security/nss/fuzz/config')
-rw-r--r--security/nss/fuzz/config/clone_corpus.sh4
-rw-r--r--security/nss/fuzz/config/clone_libfuzzer.sh6
-rw-r--r--security/nss/fuzz/config/git-copy.sh33
3 files changed, 43 insertions, 0 deletions
diff --git a/security/nss/fuzz/config/clone_corpus.sh b/security/nss/fuzz/config/clone_corpus.sh
new file mode 100644
index 000000000..856f63d95
--- /dev/null
+++ b/security/nss/fuzz/config/clone_corpus.sh
@@ -0,0 +1,4 @@
+#!/bin/sh
+
+d=$(dirname $0)
+$d/git-copy.sh https://github.com/mozilla/nss-fuzzing-corpus master $d/../corpus
diff --git a/security/nss/fuzz/config/clone_libfuzzer.sh b/security/nss/fuzz/config/clone_libfuzzer.sh
new file mode 100644
index 000000000..f1dc2e14b
--- /dev/null
+++ b/security/nss/fuzz/config/clone_libfuzzer.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+LIBFUZZER_REVISION=56bd1d43451cca4b6a11d3be316bb77ab159b09d
+
+d=$(dirname $0)
+$d/git-copy.sh https://chromium.googlesource.com/chromium/llvm-project/llvm/lib/Fuzzer $LIBFUZZER_REVISION $d/../libFuzzer
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