gecko-dev/toolkit/crashreporter/update-breakpad.sh
Gabriele Svelto b0e9d95a41 Bug 1309172 - Updated breakpad to version 69c2c51dd89965d234eec16e3a9353634831916b; r=ted.mielczarek
This includes both the vanilla sources we haven't forked and the client
sources that we have. Client patches were applied manually up to version
69c2c51dd89965d234eec16e3a9353634831916b. The following changes were not
included as they break merging segments corresponding to libxul.so in the
module list:

8915f7be39448d9257b6da3ad0233944d1d9a92a
17ad0c18b179c135fc5a3d2bba199c3fa4276035
94b6309aecaddfcf11672f6cfad9575d68ad3b40

With these changes applied two entries for libxul.so are generated, the second
one is bogus and prevents symbolication from working correctly.

The build system and some of the tools relying on breakpad were also updated
to work with the new version.

--HG--
extra : source : fe4d49307f8890a0c430c257c96f74a9552eeb31
extra : histedit_source : bc84861445bd93856cd0d0c864fd15ad7d9ccc12%2C1efd65797da46e33481afa61a302098780b0f107
2018-06-19 13:47:13 +02:00

71 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
set -v -e -x
# Usage: update-breakpad.sh <path to breakpad git clone> [rev, defaults to HEAD]
if [ $# -lt 1 ]; then
echo "Usage: update-breakpad.sh /path/to/breakpad/src [rev]"
exit 1
fi
crashreporter_dir=`realpath $(dirname $0)`
repo=${crashreporter_dir}/../..
rm -rf ${crashreporter_dir}/google-breakpad
breakpad_repo=$1
rev=${2-HEAD}
(cd $breakpad_repo; git archive --prefix=toolkit/crashreporter/google-breakpad/ $rev) | (cd $repo; tar xf -)
# Breakpad uses gclient for externals, so manually export what we need.
lss_rev=$(cd $breakpad_repo; git show ${rev}:DEPS | python -c "import sys; exec sys.stdin; print deps['src/src/third_party/lss'].split('@')[1]")
(cd $breakpad_repo/src/third_party/lss; git archive --prefix=toolkit/crashreporter/google-breakpad/src/third_party/lss/ $lss_rev) | (cd $repo; tar xf -)
# remove some extraneous bits
# We've forked src/client toolkit/crashreporter/breakpad-client.
rm -rf \
${crashreporter_dir}/google-breakpad/appveyor.yml \
${crashreporter_dir}/google-breakpad/docs/ \
${crashreporter_dir}/google-breakpad/autotools/ \
${crashreporter_dir}/google-breakpad/m4/ \
${crashreporter_dir}/google-breakpad/scripts/ \
${crashreporter_dir}/google-breakpad/src/client/ \
${crashreporter_dir}/google-breakpad/src/third_party/protobuf \
${crashreporter_dir}/google-breakpad/src/testing/ \
${crashreporter_dir}/google-breakpad/src/tools/gyp/ \
${crashreporter_dir}/google-breakpad/src/processor/testdata/ \
${crashreporter_dir}/google-breakpad/src/tools/windows/dump_syms/testdata/ \
${crashreporter_dir}/google-breakpad/.travis.yml
# restore our Makefile.ins
hg -R ${repo} st -n | grep "Makefile\.in$" | xargs hg revert --no-backup
# and moz.build files
hg -R ${repo} st -n | grep "moz\.build$" | xargs hg revert --no-backup
# and some other makefiles
hg -R ${repo} st -n | grep "objs\.mozbuild$" | xargs hg revert --no-backup
# Record git rev
(cd $breakpad_repo; git rev-parse $rev) > ${crashreporter_dir}/google-breakpad/GIT-INFO
# Apply any local patches
shopt -s nullglob
for p in ${crashreporter_dir}/breakpad-patches/*.patch; do
if grep -q -e "--git" $p; then
patch_opts="-p1"
else
patch_opts="-p0"
fi
echo "Applying $p"
if ! filterdiff -x '*/Makefile*' $p | \
patch -d ${crashreporter_dir}/google-breakpad ${patch_opts}; then
echo "Failed to apply $p"
exit 1
fi
done
# remove any .orig files that snuck in
find ${crashreporter_dir}/google-breakpad -name "*.orig" -exec rm '{}' \;
hg addremove ${crashreporter_dir}/google-breakpad/