]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
Tweak version handling to allow vendor-specific suffixes without patching.
authorDarren Salt <linux@youmustbejoking.demon.co.uk>
Mon, 25 Jan 2010 22:57:02 +0000 (22:57 +0000)
committerJohannes Berg <johannes@sipsolutions.net>
Tue, 26 Jan 2010 06:40:00 +0000 (07:40 +0100)
This overrides the "git describe" suffix for when the packaging is in git.

Makefile
version.sh

index 2c5fd9e8141ef968a7acee17f9751505589cd5a2..8d6c700be9f9a5f1459a9adcf964ee837f0c1210 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -29,7 +29,11 @@ VERSION_OBJS := $(filter-out version.o, $(OBJS))
 version.c: version.sh $(patsubst %.o,%.c,$(VERSION_OBJS)) rfkill.h Makefile \
                $(wildcard .git/index .git/refs/tags)
        @$(NQ) ' GEN ' $@
+ifeq (,$(VERSION_SUFFIX))
        $(Q)./version.sh $@
+else
+       $(Q)./version.sh --suffix "$(VERSION_SUFFIX)" $@
+endif
 
 %.o: %.c rfkill.h
        @$(NQ) ' CC  ' $@
index 957684b8f8c516a176c8d7f603f5594b59c3abc5..28b579a0ba24b524d69843d197a935123c700565 100755 (executable)
@@ -1,9 +1,18 @@
 #!/bin/sh
 
 VERSION="0.3"
+
+SUFFIX=
+if test "x$1" = x--suffix; then
+       shift
+       SUFFIX="-$1"
+       shift
+fi
 OUT="$1"
 
-if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+if test "x$SUFFIX" != 'x'; then
+       v="$VERSION$SUFFIX"
+elif head=`git rev-parse --verify HEAD 2>/dev/null`; then
        git update-index --refresh --unmerged > /dev/null
        descr=$(git describe 2>/dev/null || echo "v$VERSION")