Match: Refactor the unsigned SAT_ADD match pattern [NFC]
[gcc.git] / libffi / merge.sh
blobb36fbb92185b48c069ce7becce025cc6298b965b
1 #!/bin/bash
3 # FIXME: do we need a license (or whatever else) header here?
5 # This script merges libffi sources from upstream.
7 # Default to the tip of master branch.
8 commit=${1-master}
10 fatal() {
11 echo "$1"
12 exit 1;
15 get_upstream() {
16 rm -rf upstream
17 git clone https://github.com/libffi/libffi.git upstream
18 pushd upstream
19 git checkout $commit || fatal "Failed to checkout $commit"
20 popd
23 get_current_rev() {
24 cd upstream
25 git rev-parse HEAD
28 pwd | grep 'libffi$' || \
29 fatal "Run this script from the libffi directory"
30 get_upstream
31 CUR_REV=$(get_current_rev)
32 echo Current upstream revision: $CUR_REV
34 # Remove the unused files.
35 pushd upstream
36 rm -rf ChangeLog.old .appveyor* .ci .github .gitignore .travis* \
37 config.guess config.sub libtool-ldflags m4 make_sunver.pl \
38 msvc_build
39 rm -rf .git autogen.sh
40 cp -a . ..
41 popd
43 rm -rf upstream
45 # Update the MERGE file.
46 cat << EOF > MERGE
47 $CUR_REV
49 The first line of this file holds the git revision number of the
50 last merge done from the master library sources.
51 EOF