toolkit/crashreporter/update-breakpad.sh
author Mark Finkle <mfinkle@mozilla.com>
Wed, 06 Nov 2013 17:59:07 -0500
changeset 169458 0039e0f220bf89881c9c606b0c5aa3ff749cee68
parent 135351 83d1008f43115843ca4bcdbbbf0f02e0f4090dab
child 319911 0e628eff02f5cf6fdc118ef0e61f3e17f627e7d2
permissions -rwxr-xr-x
Bug 880123 - Add support for content callback interfaces to GeckoView r=blassey

#!/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/