die on checkout failure. pull from remote if dir does not exist.
This commit is contained in:
parent
fda6c5444e
commit
30d2392b11
|
@ -5,14 +5,22 @@ os_dir=$(dirname "$(./platform/os.sh)")
|
||||||
|
|
||||||
if test -n "$1"; then
|
if test -n "$1"; then
|
||||||
if test "$1" = 'remote'; then
|
if test "$1" = 'remote'; then
|
||||||
git clone git://github.com/bitcoin/bitcoin.git || exit 1
|
git clone git://github.com/bitcoin/bitcoin.git libbitcoind || exit 1
|
||||||
btc_dir="${cur_dir}/bitcoin"
|
btc_dir="${cur_dir}/libbitcoind"
|
||||||
else
|
else
|
||||||
btc_dir=$1
|
btc_dir=$1
|
||||||
|
if ! test -d "$btc_dir"; then
|
||||||
|
"$0" remote
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
shift
|
shift
|
||||||
else
|
else
|
||||||
btc_dir="${HOME}/bitcoin"
|
btc_dir="${HOME}/bitcoin"
|
||||||
|
if ! test -d "$btc_dir"; then
|
||||||
|
"$0" remote
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
./patch-bitcoin.sh "$btc_dir" || exit 1
|
./patch-bitcoin.sh "$btc_dir" || exit 1
|
||||||
|
|
|
@ -7,6 +7,11 @@ cd "$dir" || exit 1
|
||||||
|
|
||||||
if test -e .git; then
|
if test -e .git; then
|
||||||
git checkout 4383319e4e0cb96818d2be734f7280181daac9fa
|
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
|
git checkout -b "libbitcoind-$(date '+%Y.%m.%d')" || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue