Changeset View
Changeset View
Standalone View
Standalone View
share/genbuild.sh
Show All 13 Lines | if [ $# -gt 0 ]; then | ||||
fi | fi | ||||
else | else | ||||
echo "Usage: $0 <filename> <srcroot>" | echo "Usage: $0 <filename> <srcroot>" | ||||
exit 1 | exit 1 | ||||
fi | fi | ||||
DESC="" | DESC="" | ||||
SUFFIX="" | SUFFIX="" | ||||
if [ -e "$(which git 2>/dev/null)" -a "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; then | if [ -e "$(command -v git)" ] && [ "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = "true" ]; 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 | ||||
# if latest commit is tagged and not dirty, then override using the tag name | # if latest commit is tagged and not dirty, then override using the tag name | ||||
RAWDESC=$(git describe --abbrev=0 2>/dev/null) | RAWDESC=$(git describe --abbrev=0 2>/dev/null) | ||||
if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then | if [ "$(git rev-parse HEAD)" = "$(git rev-list -1 $RAWDESC 2>/dev/null)" ]; then | ||||
git diff-index --quiet HEAD -- && DESC=$RAWDESC | git diff-index --quiet HEAD -- && DESC=$RAWDESC | ||||
fi | fi | ||||
# otherwise generate suffix from git, i.e. string like "59887e8-dirty" | # otherwise generate suffix from git, i.e. string like "59887e8-dirty" | ||||
Show All 16 Lines |