2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 # Usage: update-breakpad.sh <path to breakpad git clone> [rev, defaults to HEAD]
11 echo "Usage: update-breakpad.sh /path/to/breakpad/src [rev]"
15 crashreporter_dir
=`realpath $(dirname $0)`
16 repo
=${crashreporter_dir}/..
/..
17 rm -rf ${crashreporter_dir}/google-breakpad
21 (cd $breakpad_repo; git archive
--prefix=toolkit
/crashreporter
/google-breakpad
/ $rev) |
(cd $repo; tar xf
-)
22 # Breakpad uses gclient for externals, so manually export what we need.
23 lss_rev
=$
(cd $breakpad_repo; git show
${rev}:DEPS | python
-c "import sys; exec(sys.stdin.read()); sys.stdout.write('%s\n' % deps['src/src/third_party/lss'].split('@')[1])")
24 (cd $breakpad_repo/src
/third_party
/lss
; git archive
--prefix=toolkit
/crashreporter
/google-breakpad
/src
/third_party
/lss
/ $lss_rev) |
(cd $repo; tar xf
-)
26 # remove some extraneous bits
27 # We've forked src/client toolkit/crashreporter/breakpad-client.
29 ${crashreporter_dir}/google-breakpad
/appveyor.yml \
30 ${crashreporter_dir}/google-breakpad
/autotools
/ \
31 ${crashreporter_dir}/google-breakpad
/docs
/ \
32 ${crashreporter_dir}/google-breakpad
/m
4/ \
33 ${crashreporter_dir}/google-breakpad
/scripts
/ \
34 ${crashreporter_dir}/google-breakpad
/src
/client
/ \
35 ${crashreporter_dir}/google-breakpad
/src
/processor
/testdata
/ \
36 ${crashreporter_dir}/google-breakpad
/src
/testing
/ \
37 ${crashreporter_dir}/google-breakpad
/src
/third_party
/linux \
38 ${crashreporter_dir}/google-breakpad
/src
/third_party
/protobuf \
39 ${crashreporter_dir}/google-breakpad
/src
/tools
/gyp
/ \
40 ${crashreporter_dir}/google-breakpad
/src
/tools
/windows
/dump_syms
/testdata
/ \
41 ${crashreporter_dir}/google-breakpad
/.github
/mistaken-pull-closer.yml \
42 ${crashreporter_dir}/google-breakpad
/.travis.yml
44 # restore our Makefile.ins
45 hg
-R ${repo} st
-n |
grep "Makefile\.in$" |
xargs hg revert
--no-backup
47 hg
-R ${repo} st
-n |
grep "moz\.build$" |
xargs hg revert
--no-backup
48 # and some other makefiles
49 hg
-R ${repo} st
-n |
grep "objs\.mozbuild$" |
xargs hg revert
--no-backup
52 (cd $breakpad_repo; git rev-parse
$rev) > ${crashreporter_dir}/google-breakpad
/GIT-INFO
54 # Apply any local patches
56 for p
in ${crashreporter_dir}/breakpad-patches
/*.
patch; do
57 if grep -q -e "--git" $p; then
63 if ! filterdiff
-x '*/Makefile*' $p | \
64 patch -d ${crashreporter_dir}/google-breakpad
${patch_opts}; then
65 echo "Failed to apply $p"
69 # remove any .orig files that snuck in
70 find ${crashreporter_dir}/google-breakpad
-name "*.orig" -exec rm '{}' \
;
72 hg addremove
${crashreporter_dir}/google-breakpad
/