summaryrefslogtreecommitdiffstats
path: root/security/nss/fuzz/config
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /security/nss/fuzz/config
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'security/nss/fuzz/config')
-rwxr-xr-xsecurity/nss/fuzz/config/clone_corpus.sh4
-rwxr-xr-xsecurity/nss/fuzz/config/git-copy.sh34
2 files changed, 38 insertions, 0 deletions
diff --git a/security/nss/fuzz/config/clone_corpus.sh b/security/nss/fuzz/config/clone_corpus.sh
new file mode 100755
index 0000000000..856f63d95a
--- /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/git-copy.sh b/security/nss/fuzz/config/git-copy.sh
new file mode 100755
index 0000000000..fac8cbecf4
--- /dev/null
+++ b/security/nss/fuzz/config/git-copy.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+
+set -ex
+
+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
+
+rm -rf "$DIR"
+git init -q "$DIR"
+git -C "$DIR" fetch -q --depth=1 "$REPO" "$COMMIT"
+git -C "$DIR" reset -q --hard FETCH_HEAD
+git -C "$DIR" rev-parse --verify HEAD > "$DIR"/.git-copy
+rm -rf "$DIR"/.git