Skip to content

Commit

Permalink
Merge #749: [Build] Update genbuild.sh script
Browse files Browse the repository at this point in the history
3eef1b9 [Build] Update genbuild.sh script (Fuzzbawls)

Tree-SHA512: b94abc47dd8effbefd40c933d33053ff7a0ec7ca86b17fb98c0ea9c7a09afee7c6a9facf59e57d0f89245f09d3312b301178404e18c30ec651308be23ddbaad6
  • Loading branch information
Fuzzbawls committed Oct 20, 2018
2 parents e820cf3 + 3eef1b9 commit 36ff235
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions share/genbuild.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh
# Copyright (c) 2012-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C
if [ $# -gt 1 ]; then
cd "$2"
cd "$2" || exit 1
fi
if [ $# -gt 0 ]; then
FILE="$1"
Expand All @@ -13,16 +18,20 @@ else
exit 1
fi

git_check_in_repo() {
! { git status --porcelain -uall --ignored "$@" 2>/dev/null || echo '??'; } | grep -q '?'
}

DESC=""
SUFFIX=""
LAST_COMMIT_DATE=""
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" ] && git_check_in_repo share/genbuild.sh; then
# clean 'dirty' status of touched files that haven't been modified
git diff >/dev/null 2>/dev/null

# if latest commit is tagged and not dirty, then override using the tag name
RAWDESC=$(git describe --abbrev=0 2>/dev/null)
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC)" ]; then
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then
git diff-index --quiet HEAD -- && DESC=$RAWDESC
fi

Expand Down

0 comments on commit 36ff235

Please sign in to comment.