gecko-dev/toolkit/components/protobuf/upgrade_protobuf.sh
Nick Fitzgerald 3a7487a7d0 Bug 1024774 - Part 0: Upgrade the protobuf library. r=mmc,glandium
--HG--
rename : toolkit/components/protobuf/google/protobuf/extension_set.cc => toolkit/components/protobuf/src/google/protobuf/extension_set.cc
rename : toolkit/components/protobuf/google/protobuf/extension_set.h => toolkit/components/protobuf/src/google/protobuf/extension_set.h
rename : toolkit/components/protobuf/google/protobuf/generated_message_util.cc => toolkit/components/protobuf/src/google/protobuf/generated_message_util.cc
rename : toolkit/components/protobuf/google/protobuf/generated_message_util.h => toolkit/components/protobuf/src/google/protobuf/generated_message_util.h
rename : toolkit/components/protobuf/google/protobuf/io/coded_stream.cc => toolkit/components/protobuf/src/google/protobuf/io/coded_stream.cc
rename : toolkit/components/protobuf/google/protobuf/io/coded_stream.h => toolkit/components/protobuf/src/google/protobuf/io/coded_stream.h
rename : toolkit/components/protobuf/google/protobuf/io/coded_stream_inl.h => toolkit/components/protobuf/src/google/protobuf/io/coded_stream_inl.h
rename : toolkit/components/protobuf/google/protobuf/io/package_info.h => toolkit/components/protobuf/src/google/protobuf/io/package_info.h
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream.cc => toolkit/components/protobuf/src/google/protobuf/io/strtod.h
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream.cc => toolkit/components/protobuf/src/google/protobuf/io/zero_copy_stream.cc
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream.h => toolkit/components/protobuf/src/google/protobuf/io/zero_copy_stream.h
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream_impl.h => toolkit/components/protobuf/src/google/protobuf/io/zero_copy_stream_impl.h
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream_impl_lite.cc => toolkit/components/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream_impl_lite.h => toolkit/components/protobuf/src/google/protobuf/io/zero_copy_stream_impl_lite.h
rename : toolkit/components/protobuf/google/protobuf/message_lite.cc => toolkit/components/protobuf/src/google/protobuf/message_lite.cc
rename : toolkit/components/protobuf/google/protobuf/message_lite.h => toolkit/components/protobuf/src/google/protobuf/message_lite.h
rename : toolkit/components/protobuf/google/protobuf/package_info.h => toolkit/components/protobuf/src/google/protobuf/package_info.h
rename : toolkit/components/protobuf/google/protobuf/generated_message_util.h => toolkit/components/protobuf/src/google/protobuf/reflection_ops.h
rename : toolkit/components/protobuf/google/protobuf/repeated_field.cc => toolkit/components/protobuf/src/google/protobuf/repeated_field.cc
rename : toolkit/components/protobuf/google/protobuf/repeated_field.h => toolkit/components/protobuf/src/google/protobuf/repeated_field.h
rename : toolkit/components/protobuf/google/protobuf/io/zero_copy_stream.cc => toolkit/components/protobuf/src/google/protobuf/service.cc
rename : toolkit/components/protobuf/google/protobuf/generated_message_util.cc => toolkit/components/protobuf/src/google/protobuf/stubs/atomicops_internals_pnacl.h
rename : toolkit/components/protobuf/google/protobuf/stubs/common.cc => toolkit/components/protobuf/src/google/protobuf/stubs/common.cc
rename : toolkit/components/protobuf/google/protobuf/stubs/common.h => toolkit/components/protobuf/src/google/protobuf/stubs/common.h
rename : toolkit/components/protobuf/google/protobuf/stubs/hash.h => toolkit/components/protobuf/src/google/protobuf/stubs/hash.h
rename : toolkit/components/protobuf/google/protobuf/stubs/once.cc => toolkit/components/protobuf/src/google/protobuf/stubs/once.cc
rename : toolkit/components/protobuf/google/protobuf/stubs/once.h => toolkit/components/protobuf/src/google/protobuf/stubs/once.h
rename : toolkit/components/protobuf/google/protobuf/stubs/stl_util-inl.h => toolkit/components/protobuf/src/google/protobuf/stubs/stl_util.h
rename : toolkit/components/protobuf/google/protobuf/generated_message_util.h => toolkit/components/protobuf/src/google/protobuf/stubs/stringprintf.h
rename : toolkit/components/protobuf/google/protobuf/wire_format_lite.cc => toolkit/components/protobuf/src/google/protobuf/wire_format_lite.cc
rename : toolkit/components/protobuf/google/protobuf/wire_format_lite.h => toolkit/components/protobuf/src/google/protobuf/wire_format_lite.h
rename : toolkit/components/protobuf/google/protobuf/wire_format_lite_inl.h => toolkit/components/protobuf/src/google/protobuf/wire_format_lite_inl.h
2015-05-28 07:37:42 -07:00

72 lines
1.5 KiB
Bash
Executable File

#!/usr/bin/env bash
set -e
usage() {
echo "Usage: upgrade_protobuf.sh path/to/protobuf"
echo
echo " Upgrades mozilla-central's copy of the protobuf library."
echo
echo " Get a protobuf release from here:"
echo " https://github.com/google/protobuf/releases"
}
if [[ "$#" -ne 1 ]]; then
usage
exit 1
fi
PROTOBUF_LIB_PATH=$1
if [[ ! -d "$PROTOBUF_LIB_PATH" ]]; then
echo No such directory: $PROTOBUF_LIB_PATH
echo
usage
exit 1
fi
realpath() {
if [[ $1 = /* ]]; then
echo "$1"
else
echo "$PWD/${1#./}"
fi
}
PROTOBUF_LIB_PATH=$(realpath $PROTOBUF_LIB_PATH)
cd $(dirname $0)
# Remove the old protobuf sources.
rm -rf src/google/*
# Add all the new protobuf sources.
cp -r $PROTOBUF_LIB_PATH/src/google/* src/google/
# Remove compiler sources.
rm -rf src/google/protobuf/compiler
# Remove test files.
find src/google -name '*test*' | xargs rm -rf
# Remove protobuf's build files.
find src/google/ -name '.deps' | xargs rm -rf
find src/google/ -name '.dirstamp' | xargs rm -rf
rm -rf src/google/protobuf/SEBS
# Apply custom changes for building as part of mozilla-central.
cd ../../.. # Top level.
echo
echo Applying custom changes for mozilla-central. If this fails, you need to
echo edit the 'toolkit/components/protobuf/src/google/*' sources manually and
echo update the 'toolkit/components/protobuf/m-c-changes.patch' patch file
echo accordingly.
echo
patch -p1 < toolkit/components/protobuf/m-c-changes.patch
echo
echo Successfully upgraded the protobuf lib!