diff options
| author | 2022-02-05 16:36:09 +0100 | |
|---|---|---|
| committer | 2022-02-05 16:36:09 +0100 | |
| commit | 7bc4d2f14e5a0bb80fd7342f954554947b9fee01 (patch) | |
| tree | 57c9379f047718305d20854aad79f2bd89a07823 | |
| parent | bf44ba84846ba3fcc6b7ad24e820086fa4c2d8a0 (diff) | |
| download | libplist-7bc4d2f14e5a0bb80fd7342f954554947b9fee01.tar.gz libplist-7bc4d2f14e5a0bb80fd7342f954554947b9fee01.tar.bz2 | |
configure: Generate usable version via git-version-gen when ran in shallow clone
| -rwxr-xr-x | git-version-gen | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/git-version-gen b/git-version-gen index b403fce..3eb6a42 100755 --- a/git-version-gen +++ b/git-version-gen | |||
| @@ -5,7 +5,11 @@ if test -n "$1"; then | |||
| 5 | else | 5 | else |
| 6 | if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then | 6 | if test -d "${SRCDIR}/.git" && test -x "`which git`" ; then |
| 7 | git update-index -q --refresh | 7 | git update-index -q --refresh |
| 8 | VER=`git describe --tags --dirty=-dirty` | 8 | if ! VER=`git describe --tags --dirty 2>/dev/null`; then |
| 9 | COMMIT=`git rev-parse --short HEAD` | ||
| 10 | DIRTY=`git diff --quiet HEAD || echo "-dirty"` | ||
| 11 | VER=`sed -n '1,/RE/s/Version \(.*\)/\1/p' ${SRCDIR}/NEWS`-git-${COMMIT}${DIRTY} | ||
| 12 | fi | ||
| 9 | else | 13 | else |
| 10 | if test -f "${SRCDIR}/.tarball-version"; then | 14 | if test -f "${SRCDIR}/.tarball-version"; then |
| 11 | VER=`cat "${SRCDIR}/.tarball-version"` | 15 | VER=`cat "${SRCDIR}/.tarball-version"` |
