toolkit/crashreporter/update-breakpad.sh

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rwxr-xr-x

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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 # Usage: update-breakpad.sh <path to breakpad SVN>
     8 if [ $# -lt 1 ]; then
     9   echo "Usage: update-breakpad.sh /path/to/google-breakpad/"
    10   exit 1
    11 fi
    13 crashreporter_dir=`dirname $0`
    14 repo=${crashreporter_dir}/../..
    15 rm -rf ${crashreporter_dir}/google-breakpad
    16 svn export $1 ${crashreporter_dir}/google-breakpad
    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
    27 # Record `svn info`
    28 svn info $1 > ${crashreporter_dir}/google-breakpad/SVN-INFO
    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
    48 hg addremove ${crashreporter_dir}/google-breakpad/

mercurial