]> git.ipfire.org Git - ipfire-2.x.git/blame - src/patches/dnsmasq/0084-Make-get-version-work-when-repo-is-a-git-submodule.patch
dnsmasq: Import more upstream fixes
[ipfire-2.x.git] / src / patches / dnsmasq / 0084-Make-get-version-work-when-repo-is-a-git-submodule.patch
CommitLineData
6ac0a1a3
MT
1From 8efd731cc4ed2baa42aa69d0a9d336392e9987cb Mon Sep 17 00:00:00 2001
2From: "Johnny S. Lee" <_@jsl.io>
3Date: Sun, 26 Apr 2015 22:23:57 +0100
5f206778 4Subject: [PATCH 84/87] Make get-version work when repo is a git submodule.
6ac0a1a3
MT
5
6---
7 bld/get-version | 5 +++--
8 1 file changed, 3 insertions(+), 2 deletions(-)
9
10diff --git a/bld/get-version b/bld/get-version
11index 7ab75db729ac..5372869c0852 100755
12--- a/bld/get-version
13+++ b/bld/get-version
14@@ -11,8 +11,9 @@
15 # If there is more than one v[0-9].* tag, sort them and use the
16 # first. This favours, eg v2.63 over 2.63rc6.
17
18-if which git >/dev/null 2>&1 && [ -d $1/.git ]; then
19- cd $1; git describe | sed 's/^v//'
20+if which git >/dev/null 2>&1 && \
21+ ([ -d $1/.git ] || grep '^gitdir:' $1/.git >/dev/null 2>&1); then
22+ cd $1; git describe | sed 's/^v//'
23 elif grep '\$Format:%d\$' $1/VERSION >/dev/null 2>&1; then
24 # unsubstituted VERSION, but no git available.
25 echo UNKNOWN
26--
272.1.0
28