die on checkout failure. pull from remote if dir does not exist.

This commit is contained in:
Christopher Jeffrey 2014-12-06 17:31:49 -08:00
parent fda6c5444e
commit 30d2392b11
2 changed files with 15 additions and 2 deletions

View File

@ -5,14 +5,22 @@ os_dir=$(dirname "$(./platform/os.sh)")
if test -n "$1"; then
if test "$1" = 'remote'; then
git clone git://github.com/bitcoin/bitcoin.git || exit 1
btc_dir="${cur_dir}/bitcoin"
git clone git://github.com/bitcoin/bitcoin.git libbitcoind || exit 1
btc_dir="${cur_dir}/libbitcoind"
else
btc_dir=$1
if ! test -d "$btc_dir"; then
"$0" remote
exit 0
fi
fi
shift
else
btc_dir="${HOME}/bitcoin"
if ! test -d "$btc_dir"; then
"$0" remote
exit 0
fi
fi
./patch-bitcoin.sh "$btc_dir" || exit 1

View File

@ -7,6 +7,11 @@ cd "$dir" || exit 1
if test -e .git; then
git checkout 4383319e4e0cb96818d2be734f7280181daac9fa
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
fi