From 8dbd2edd9855e0a95e481f3615d9549195c937ad Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Fri, 12 Feb 2016 05:36:55 +0000 Subject: [PATCH] Bugfix: Only use git for build info if the repository is actually the right one Also adds ability to disable check with BITCOIN_GENBUILD_NO_GIT=1 in the environment (cherry picked from commit bitcoin/bitcoin@e98e3dde6a976a2c8f266ee963d6931fd4b37262) --- contrib/gitian-descriptors/gitian-linux.yml | 1 + contrib/gitian-descriptors/gitian-osx.yml | 1 + contrib/gitian-descriptors/gitian-win.yml | 1 + share/genbuild.sh | 2 +- 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/contrib/gitian-descriptors/gitian-linux.yml b/contrib/gitian-descriptors/gitian-linux.yml index fc7de7de5..98d136cd0 100644 --- a/contrib/gitian-descriptors/gitian-linux.yml +++ b/contrib/gitian-descriptors/gitian-linux.yml @@ -97,6 +97,7 @@ script: | create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" # Create the release tarball using (arbitrarily) the first host + export GIT_DIR="$PWD/.git" ./autogen.sh CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ make dist diff --git a/contrib/gitian-descriptors/gitian-osx.yml b/contrib/gitian-descriptors/gitian-osx.yml index 65533d060..93ecfb14c 100644 --- a/contrib/gitian-descriptors/gitian-osx.yml +++ b/contrib/gitian-descriptors/gitian-osx.yml @@ -92,6 +92,7 @@ script: | create_per-host_faketime_wrappers "${REFERENCE_DATETIME}" # Create the release tarball using (arbitrarily) the first host + export GIT_DIR="$PWD/.git" ./autogen.sh CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ make dist diff --git a/contrib/gitian-descriptors/gitian-win.yml b/contrib/gitian-descriptors/gitian-win.yml index cab6187fa..780a83f3b 100644 --- a/contrib/gitian-descriptors/gitian-win.yml +++ b/contrib/gitian-descriptors/gitian-win.yml @@ -113,6 +113,7 @@ script: | create_per-host_linker_wrapper "${REFERENCE_DATETIME}" # Create the release tarball using (arbitrarily) the first host + export GIT_DIR="$PWD/.git" ./autogen.sh CONFIG_SITE=${BASEPREFIX}/`echo "${HOSTS}" | awk '{print $1;}'`/share/config.site ./configure --prefix=/ make dist diff --git a/share/genbuild.sh b/share/genbuild.sh index 42b5778c2..3df4bcf03 100755 --- a/share/genbuild.sh +++ b/share/genbuild.sh @@ -22,7 +22,7 @@ fi DESC="" SUFFIX="" -if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then +if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" -a -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" -a "$(git status --porcelain -u no --ignored "$0" | cut -b1)" != "?" ]; then # clean 'dirty' status of touched files that haven't been modified git diff >/dev/null 2>/dev/null