Skip to content

Commit

Permalink
Change git commands called so we can get a better description for non…
Browse files Browse the repository at this point in the history
…-release source builds

Github-Merge: PIVX-Project#402
Rebased-From: 8fa5f12
  • Loading branch information
jonspock authored and Fuzzbawls committed Nov 29, 2017
1 parent 37a39fc commit e5add53
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions share/genbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,16 @@ if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/
git diff >/dev/null 2>/dev/null

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

# otherwise generate suffix from git, i.e. string like "59887e8-dirty"
SUFFIX=$(git rev-parse --short HEAD)
git diff-index --quiet HEAD -- || SUFFIX="$SUFFIX-dirty"
git diff-index --quiet HEAD -- || DESC="$DESC-dirty"

# get a string like "2012-04-10 16:27:19 +0200"
LAST_COMMIT_DATE="$(git log -n 1 --format="%ci")"
fi

if [ -n "$DESC" ]; then
NEWINFO="#define BUILD_DESC \"$DESC\""
elif [ -n "$SUFFIX" ]; then
NEWINFO="#define BUILD_SUFFIX $SUFFIX"
else
NEWINFO="// No build information available"
fi
Expand Down

0 comments on commit e5add53

Please sign in to comment.