diff options
| author | 2022-01-25 03:43:52 +0100 | |
|---|---|---|
| committer | 2022-01-25 03:43:52 +0100 | |
| commit | 323009bfd003ff1540967b7b67efebab1ee8693d (patch) | |
| tree | 5e01fc1900db29d1d07ceb66e9958d94d3160f19 /git-version-gen | |
| parent | 17da5ba554426d732fc850e7211bae7d3a7c016e (diff) | |
| download | libplist-323009bfd003ff1540967b7b67efebab1ee8693d.tar.gz libplist-323009bfd003ff1540967b7b67efebab1ee8693d.tar.bz2 | |
autoconf: Automatically derive version number from latest git tag
Diffstat (limited to 'git-version-gen')
| -rwxr-xr-x | git-version-gen | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/git-version-gen b/git-version-gen new file mode 100755 index 0000000..6feac34 --- /dev/null +++ b/git-version-gen | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | SRCDIR=`dirname $0` | ||
| 3 | if test -n "$1"; then | ||
| 4 | VER=$1 | ||
| 5 | else | ||
| 6 | if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then | ||
| 7 | git update-index -q --refresh | ||
| 8 | VER=`git describe --tags --always --dirty=-dirty` | ||
| 9 | else | ||
| 10 | if test -f "${SRCDIR}/.tarball-version"; then | ||
| 11 | VER=`cat "${SRCDIR}/.tarball-version"` | ||
| 12 | fi | ||
| 13 | fi | ||
| 14 | fi | ||
| 15 | printf %s "$VER" | ||
