forked from libimobiledevice/usbmuxd
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
autoconf: Automatically derive version number from latest git tag
with a fallback to get the version string from a .tarball-version file
- Loading branch information
Showing
2 changed files
with
26 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/sh | ||
SRCDIR=`dirname $0` | ||
if test -n "$1"; then | ||
VER=$1 | ||
else | ||
if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then | ||
git update-index -q --refresh | ||
if ! VER=`git describe --tags --dirty 2>/dev/null`; then | ||
COMMIT=`git rev-parse --short HEAD` | ||
DIRTY=`git diff --quiet HEAD || echo "-dirty"` | ||
VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY} | ||
fi | ||
else | ||
if test -f "${SRCDIR}/.tarball-version"; then | ||
VER=`cat "${SRCDIR}/.tarball-version"` | ||
fi | ||
fi | ||
fi | ||
printf %s "$VER" |