mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-20 16:55:40 +00:00
a15a27b2f0
Differential Revision: https://phabricator.services.mozilla.com/D27701 --HG-- extra : moz-landing-system : lando
32 lines
789 B
Bash
Executable File
32 lines
789 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Optionally get revision from cmd line
|
|
# Changelog: https://reviews.llvm.org/source/compiler-rt/history/compiler-rt/trunk/lib/fuzzer/
|
|
[ $1 ] && REVISION=$1 || REVISION=356365
|
|
|
|
mkdir tmp
|
|
svn co -qr $REVISION https://llvm.org/svn/llvm-project/compiler-rt/trunk tmp || exit
|
|
|
|
if [ $1 ]; then
|
|
# libFuzzer source files
|
|
CPPS=($(ls -rv tmp/lib/fuzzer/*.cpp))
|
|
CPPS=(${CPPS[@]##*/})
|
|
CPPS=(${CPPS[@]##FuzzerMain*}) # ignored
|
|
|
|
# Update SOURCES entries
|
|
sed -e "/^SOURCES/,/^]/ {/'/d}" -i moz.build
|
|
for CPP in ${CPPS[@]}; do sed -e "/^SOURCES/ a \\\t'${CPP}'," -i moz.build; done
|
|
|
|
# Remove previous files
|
|
rm *.{cpp,h,def}
|
|
fi
|
|
|
|
# Copy files
|
|
cp tmp/lib/fuzzer/*.{cpp,h,def} .
|
|
|
|
# Remove the temporary directory
|
|
rm -Rf tmp/
|
|
|
|
[ $1 ] && echo "Updated libFuzzer to ${REVISION}"
|
|
|