From 11e08dbed9af7d84b3cbeab90f8dfc0f6c497f16 Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Sat, 6 Dec 2014 16:01:03 -0800 Subject: [PATCH] add git functionality to patch-bitcoin.sh. --- patch-bitcoin.sh | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/patch-bitcoin.sh b/patch-bitcoin.sh index c59c1e5b..d2a27e88 100755 --- a/patch-bitcoin.sh +++ b/patch-bitcoin.sh @@ -1,5 +1,19 @@ -#!/bin/bash +#!/bin/sh dir=$(test -n "$1" && echo "$1" || echo "${HOME}/bitcoin") + cd "$dir" || exit 1 -patch -p1 < libbitcoind.patch + +if test -e .git; then + git checkout -b libbitcoind || exit 1 +fi + +patch -p1 < libbitcoind.patch || exit 1 + +if test -e .git; then + git add --all || exit 1 + git commit -a -m 'allow compiling of libbitcoind.so.' || exit 1 +fi + +echo 'Patch completed successfully.' +exit 0