Bug 1887774 convert from MediaEnginePrefs to AudioProcessing config in AudioInputProc...
[gecko.git] / toolkit / crashreporter / update-breakpad.sh
blob67c17338d4e142b29bfb94637d976db91a88751a
1 #!/bin/bash
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/.
6 set -v -e -x
8 # Usage: update-breakpad.sh <path to breakpad git clone> [rev, defaults to HEAD]
10 if [ $# -lt 1 ]; then
11 echo "Usage: update-breakpad.sh /path/to/breakpad/src [rev]"
12 exit 1
15 crashreporter_dir=`realpath $(dirname $0)`
16 repo=${crashreporter_dir}/../..
17 rm -rf ${crashreporter_dir}/google-breakpad
19 breakpad_repo=$1
20 rev=${2-HEAD}
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.
28 rm -rf \
29 ${crashreporter_dir}/google-breakpad/appveyor.yml \
30 ${crashreporter_dir}/google-breakpad/autotools/ \
31 ${crashreporter_dir}/google-breakpad/docs/ \
32 ${crashreporter_dir}/google-breakpad/m4/ \
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
46 # and moz.build files
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
51 # Record git rev
52 (cd $breakpad_repo; git rev-parse $rev) > ${crashreporter_dir}/google-breakpad/GIT-INFO
54 # Apply any local patches
55 shopt -s nullglob
56 for p in ${crashreporter_dir}/breakpad-patches/*.patch; do
57 if grep -q -e "--git" $p; then
58 patch_opts="-p1"
59 else
60 patch_opts="-p0"
62 echo "Applying $p"
63 if ! filterdiff -x '*/Makefile*' $p | \
64 patch -d ${crashreporter_dir}/google-breakpad ${patch_opts}; then
65 echo "Failed to apply $p"
66 exit 1
68 done
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/