]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/dnsmasq/0084-Make-get-version-work-when-repo-is-a-git-submodule.patch
38670a819af9fffd642018f6357d985b216e7ead
[ipfire-2.x.git] / src / patches / dnsmasq / 0084-Make-get-version-work-when-repo-is-a-git-submodule.patch
1 From 8efd731cc4ed2baa42aa69d0a9d336392e9987cb Mon Sep 17 00:00:00 2001
2 From: "Johnny S. Lee" <_@jsl.io>
3 Date: Sun, 26 Apr 2015 22:23:57 +0100
4 Subject: [PATCH 84/87] Make get-version work when repo is a git submodule.
5
6 ---
7 bld/get-version | 5 +++--
8 1 file changed, 3 insertions(+), 2 deletions(-)
9
10 diff --git a/bld/get-version b/bld/get-version
11 index 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 --
27 2.1.0
28