toolkit/crashreporter/update-breakpad.sh

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/toolkit/crashreporter/update-breakpad.sh	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +#!/bin/bash
     1.5 +# This Source Code Form is subject to the terms of the Mozilla Public
     1.6 +# License, v. 2.0. If a copy of the MPL was not distributed with this
     1.7 +# file, You can obtain one at http://mozilla.org/MPL/2.0/.
     1.8 +
     1.9 +# Usage: update-breakpad.sh <path to breakpad SVN>
    1.10 +
    1.11 +if [ $# -lt 1 ]; then
    1.12 +  echo "Usage: update-breakpad.sh /path/to/google-breakpad/"
    1.13 +  exit 1
    1.14 +fi
    1.15 +
    1.16 +crashreporter_dir=`dirname $0`
    1.17 +repo=${crashreporter_dir}/../..
    1.18 +rm -rf ${crashreporter_dir}/google-breakpad
    1.19 +svn export $1 ${crashreporter_dir}/google-breakpad
    1.20 +
    1.21 +# remove some extraneous bits
    1.22 +rm -rf ${crashreporter_dir}/google-breakpad/src/third_party/protobuf ${crashreporter_dir}/google-breakpad/src/testing/ ${crashreporter_dir}/google-breakpad/src/tools/gyp/
    1.23 +# restore our Makefile.ins
    1.24 +hg -R ${repo} st -n | grep "Makefile\.in$" | xargs hg revert --no-backup
    1.25 +# and moz.build files
    1.26 +hg -R ${repo} st -n | grep "moz\.build$" | xargs hg revert --no-backup
    1.27 +# and some other makefiles
    1.28 +hg -R ${repo} st -n | grep "objs\.mk$" | xargs hg revert --no-backup
    1.29 +
    1.30 +# Record `svn info`
    1.31 +svn info $1 > ${crashreporter_dir}/google-breakpad/SVN-INFO
    1.32 +
    1.33 +# Apply any local patches
    1.34 +shopt -s nullglob
    1.35 +for p in ${crashreporter_dir}/breakpad-patches/*.patch; do
    1.36 +    if grep -q -e "--git" $p; then
    1.37 +        patch_opts="-p1"
    1.38 +    else
    1.39 +        patch_opts="-p0"
    1.40 +    fi
    1.41 +    echo "Applying $p"
    1.42 +    if ! filterdiff -x '*/Makefile*' $p | \
    1.43 +        patch -d ${crashreporter_dir}/google-breakpad ${patch_opts}; then
    1.44 +      echo "Failed to apply $p"
    1.45 +      exit 1
    1.46 +    fi
    1.47 +done
    1.48 +# remove any .orig files that snuck in
    1.49 +find ${crashreporter_dir}/google-breakpad -name "*.orig" -print0 | xargs -0 rm
    1.50 +
    1.51 +hg addremove ${crashreporter_dir}/google-breakpad/

mercurial