mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-06-02 15:32:34 +02:00
Merge 18902 via fix_gitdir_again
This commit is contained in:
commit
148d95ab84
@ -15,6 +15,11 @@ GIT_ARCHIVE="$1"
|
|||||||
DISTNAME="$2"
|
DISTNAME="$2"
|
||||||
|
|
||||||
git archive --prefix="${DISTNAME}/" HEAD | tar -xp
|
git archive --prefix="${DISTNAME}/" HEAD | tar -xp
|
||||||
|
|
||||||
|
# Generate correct build info file from git, before we lose git
|
||||||
|
GIT_BUILD_INFO="$(share/genbuild.sh /dev/stdout)"
|
||||||
|
sed 's/\/\/ No build information available/'"${GIT_BUILD_INFO}"'/' -i "${DISTNAME}/share/genbuild.sh"
|
||||||
|
|
||||||
cd "${DISTNAME}"
|
cd "${DISTNAME}"
|
||||||
|
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
|
@ -18,9 +18,14 @@ else
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# This checks that we are actually part of the intended git repository, and not just getting info about some unrelated git repository that the code happens to be in a directory under
|
||||||
|
git_check_in_repo() {
|
||||||
|
! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
|
||||||
|
}
|
||||||
|
|
||||||
GIT_TAG=""
|
GIT_TAG=""
|
||||||
GIT_COMMIT=""
|
GIT_COMMIT=""
|
||||||
if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then
|
if [ "${BITCOIN_GENBUILD_NO_GIT}" != "1" ] && [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ] && git_check_in_repo share/genbuild.sh; then
|
||||||
# clean 'dirty' status of touched files that haven't been modified
|
# clean 'dirty' status of touched files that haven't been modified
|
||||||
git diff >/dev/null 2>/dev/null
|
git diff >/dev/null 2>/dev/null
|
||||||
|
|
||||||
@ -40,7 +45,9 @@ if [ -n "$GIT_TAG" ]; then
|
|||||||
elif [ -n "$GIT_COMMIT" ]; then
|
elif [ -n "$GIT_COMMIT" ]; then
|
||||||
NEWINFO="#define BUILD_GIT_COMMIT \"$GIT_COMMIT\""
|
NEWINFO="#define BUILD_GIT_COMMIT \"$GIT_COMMIT\""
|
||||||
else
|
else
|
||||||
NEWINFO="// No build information available"
|
# NOTE: The NEWINFO line below this comment gets replaced by a string-match in contrib/guix/libexec/make_release_tarball.sh
|
||||||
|
# If changing it, update the script too!
|
||||||
|
NEWINFO='// No build information available'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# only update build.h if necessary
|
# only update build.h if necessary
|
||||||
|
Loading…
Reference in New Issue
Block a user