2014-12-06 16:01:03 -08:00
|
|
|
#!/bin/sh
|
2014-12-06 15:56:26 -08:00
|
|
|
|
2014-12-09 13:24:24 -08:00
|
|
|
root_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/.."
|
|
|
|
cd "$root_dir"
|
2014-12-06 15:56:26 -08:00
|
|
|
dir=$(test -n "$1" && echo "$1" || echo "${HOME}/bitcoin")
|
2014-12-09 12:15:30 -08:00
|
|
|
patch_file="$(pwd)/bitcoin.patch"
|
2014-12-06 16:01:03 -08:00
|
|
|
|
2014-12-06 15:56:26 -08:00
|
|
|
cd "$dir" || exit 1
|
2014-12-06 16:01:03 -08:00
|
|
|
|
2014-12-07 00:24:57 -08:00
|
|
|
if ! test -d .git; then
|
|
|
|
echo 'Please point this script to an upstream bitcoin git repo.'
|
|
|
|
exit 1
|
2014-12-06 16:01:03 -08:00
|
|
|
fi
|
|
|
|
|
2014-12-09 12:20:36 -08:00
|
|
|
git checkout 0a1d03ca5265293e6419b0ffb68d277da6b1d9a0
|
2014-12-07 00:24:57 -08:00
|
|
|
if test $? -ne 0; then
|
|
|
|
echo 'Unable to checkout necessary commit.'
|
|
|
|
echo 'Please pull the latest HEAD from the upstream bitcoin repo.'
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
git checkout -b "libbitcoind-$(date '+%Y.%m.%d')" || exit 1
|
|
|
|
|
2014-12-06 16:03:02 -08:00
|
|
|
patch -p1 < "$patch_file" || exit 1
|
2014-12-06 16:01:03 -08:00
|
|
|
|
2014-12-07 00:24:57 -08:00
|
|
|
git add --all || exit 1
|
|
|
|
git commit -a -m 'allow compiling of libbitcoind.so.' || exit 1
|
2014-12-06 16:01:03 -08:00
|
|
|
|
|
|
|
echo 'Patch completed successfully.'
|
|
|
|
exit 0
|