blob: 12e890a7db16e03d4af9f23635b7b6088e20d177 [file] [log] [blame]
#!/bin/sh
set -xe
# If a branch name is passed on the command line then sync
# to that instead of HEAD.
branch="$1"
old_revision=$(cat BORINGSSL_REVISION)
rm -Rf src
git clone https://boringssl.googlesource.com/boringssl src
cd src
if [ "$branch" ]; then
git checkout "$branch"
fi
new_revision=$(git show -s --pretty=%H)
if [ "$branch" ]; then
target="branch $branch"
else
target="$new_revision"
fi
msgfile=$(mktemp)
echo "external/boringssl: Sync to ${target}.
This includes the following changes:
https://boringssl.googlesource.com/boringssl/+log/${old_revision}..${new_revision}
" > $msgfile
# Just pull out commit titles and any Update-Note paragraphs for AOSP commit summary
git log --format='format:* %s%n%n%b' ${old_revision}..${new_revision} \
| awk -v RS='' -v ORS='\n' '/^Update-Note/ {print} /^\*/ {print}' \
>> $msgfile
cd ..
echo "
Test: atest CtsLibcoreTestCases CtsLibcoreOkHttpTestCases boringssl_crypto_test boringssl_ssl_test" >> $msgfile
if [ ! "$branch" ]; then
echo ${new_revision} > BORINGSSL_REVISION
fi
rm -Rf src/.git
rm -Rf src/fuzz
rm -Rf src/third_party/googletest
rm -Rf linux-aarch64/ linux-arm/ linux-x86/ linux-x86_64/ mac-x86/ mac-x86_64/ win-x86_64/ win-x86/
python src/util/generate_build_files.py android android-cmake bazel eureka
cp src/LICENSE NOTICE
git add .
git commit --no-verify -F $msgfile
rm -f $msgfile