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/.
8 # Usage: update-jsoncpp.sh <path to jsoncpp git clone> [rev, defaults to HEAD]
11 echo "Usage: update-jsoncpp.sh /path/to/jsoncpp/src [rev]"
15 components_dir
=$
(realpath $
(dirname $0))
16 repo
=${components_dir}/..
/..
17 rm -rf ${components_dir}/jsoncpp
21 (cd $jsoncpp_repo; git archive
--prefix=toolkit
/components
/jsoncpp
/ $rev) |
(cd $repo; tar xf
-)
23 # remove some extraneous bits
25 ${components_dir}/jsoncpp
/.clang-format \
26 ${components_dir}/jsoncpp
/.gitattributes \
27 ${components_dir}/jsoncpp
/.gitignore \
28 ${components_dir}/jsoncpp
/.travis.yml \
29 ${components_dir}/jsoncpp
/CMakeLists.txt \
30 ${components_dir}/jsoncpp
/SConstruct \
31 ${components_dir}/jsoncpp
/amalgamate.py \
32 ${components_dir}/jsoncpp
/appveyor.yml \
33 ${components_dir}/jsoncpp
/dev.makefile \
34 ${components_dir}/jsoncpp
/devtools \
35 ${components_dir}/jsoncpp
/doc \
36 ${components_dir}/jsoncpp
/doxybuild.py \
37 ${components_dir}/jsoncpp
/include
/CMakeLists.txt \
38 ${components_dir}/jsoncpp
/makefiles \
39 ${components_dir}/jsoncpp
/makerelease.py \
40 ${components_dir}/jsoncpp
/pkg-config \
41 ${components_dir}/jsoncpp
/scons-tools \
42 ${components_dir}/jsoncpp
/src
/CMakeLists.txt \
43 ${components_dir}/jsoncpp
/src
/jsontestrunner \
44 ${components_dir}/jsoncpp
/src
/lib_json
/CMakeLists.txt \
45 ${components_dir}/jsoncpp
/src
/lib_json
/sconscript \
46 ${components_dir}/jsoncpp
/src
/lib_json
/version.h.
in \
47 ${components_dir}/jsoncpp
/src
/test_lib_json \
48 ${components_dir}/jsoncpp
/test \
49 ${components_dir}/jsoncpp
/travis.sh \
50 ${components_dir}/jsoncpp
/version \
51 ${components_dir}/jsoncpp
/version.
in
53 # restore our moz.build files
54 hg
-R ${repo} st
-n |
grep "moz\.build$" |
xargs hg revert
--no-backup
57 (cd $jsoncpp_repo; git rev-parse
$rev) > ${components_dir}/jsoncpp
/GIT-INFO
59 # remove any .orig files that snuck in
60 find ${components_dir}/jsoncpp
-name "*.orig" -exec rm '{}' \
;
62 hg addremove
${components_dir}/jsoncpp
/