|
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/. |
|
5 |
|
6 # Usage: update-breakpad.sh <path to breakpad SVN> |
|
7 |
|
8 if [ $# -lt 1 ]; then |
|
9 echo "Usage: update-breakpad.sh /path/to/google-breakpad/" |
|
10 exit 1 |
|
11 fi |
|
12 |
|
13 crashreporter_dir=`dirname $0` |
|
14 repo=${crashreporter_dir}/../.. |
|
15 rm -rf ${crashreporter_dir}/google-breakpad |
|
16 svn export $1 ${crashreporter_dir}/google-breakpad |
|
17 |
|
18 # remove some extraneous bits |
|
19 rm -rf ${crashreporter_dir}/google-breakpad/src/third_party/protobuf ${crashreporter_dir}/google-breakpad/src/testing/ ${crashreporter_dir}/google-breakpad/src/tools/gyp/ |
|
20 # restore our Makefile.ins |
|
21 hg -R ${repo} st -n | grep "Makefile\.in$" | xargs hg revert --no-backup |
|
22 # and moz.build files |
|
23 hg -R ${repo} st -n | grep "moz\.build$" | xargs hg revert --no-backup |
|
24 # and some other makefiles |
|
25 hg -R ${repo} st -n | grep "objs\.mk$" | xargs hg revert --no-backup |
|
26 |
|
27 # Record `svn info` |
|
28 svn info $1 > ${crashreporter_dir}/google-breakpad/SVN-INFO |
|
29 |
|
30 # Apply any local patches |
|
31 shopt -s nullglob |
|
32 for p in ${crashreporter_dir}/breakpad-patches/*.patch; do |
|
33 if grep -q -e "--git" $p; then |
|
34 patch_opts="-p1" |
|
35 else |
|
36 patch_opts="-p0" |
|
37 fi |
|
38 echo "Applying $p" |
|
39 if ! filterdiff -x '*/Makefile*' $p | \ |
|
40 patch -d ${crashreporter_dir}/google-breakpad ${patch_opts}; then |
|
41 echo "Failed to apply $p" |
|
42 exit 1 |
|
43 fi |
|
44 done |
|
45 # remove any .orig files that snuck in |
|
46 find ${crashreporter_dir}/google-breakpad -name "*.orig" -print0 | xargs -0 rm |
|
47 |
|
48 hg addremove ${crashreporter_dir}/google-breakpad/ |