File: update-breakpad.sh

package info (click to toggle)
iceweasel 24.8.1esr-1~deb7u1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,226,996 kB
  • sloc: cpp: 3,193,805; ansic: 1,641,175; python: 170,036; java: 128,022; asm: 118,009; xml: 81,992; sh: 70,543; makefile: 50,626; perl: 21,413; objc: 4,014; yacc: 2,066; pascal: 1,263; lex: 982; exp: 449; php: 244; lisp: 228; awk: 211; sed: 61; csh: 31; ada: 16; ruby: 3
file content (48 lines) | stat: -rwxr-xr-x 1,663 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/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/.

# Usage: update-breakpad.sh <path to breakpad SVN>

if [ $# -lt 1 ]; then
  echo "Usage: update-breakpad.sh /path/to/google-breakpad/"
  exit 1
fi

crashreporter_dir=`dirname $0`
repo=${crashreporter_dir}/../..
rm -rf ${crashreporter_dir}/google-breakpad
svn export $1 ${crashreporter_dir}/google-breakpad

# remove some extraneous bits
rm -rf ${crashreporter_dir}/google-breakpad/src/third_party/protobuf ${crashreporter_dir}/google-breakpad/src/testing/ ${crashreporter_dir}/google-breakpad/src/tools/gyp/
# 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\.mk$" | xargs hg revert --no-backup

# Record `svn info`
svn info $1 > ${crashreporter_dir}/google-breakpad/SVN-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" -print0 | xargs -0 rm

hg addremove ${crashreporter_dir}/google-breakpad/