Search Linux Wireless

[PATCH 1/3] Tweak version handling to allow vendor-specific suffixes without patching. This overrides the "git describe" suffix for when the packaging is in git.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 Makefile   |    4 ++++
 version.sh |   13 +++++++++++--
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 2c5fd9e..770efd1 100644
--- 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  ' $@
diff --git a/version.sh b/version.sh
index 957684b..8984b39 100755
--- a/version.sh
+++ b/version.sh
@@ -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" = ''; then
+	v="$VERSION"
+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")
 
@@ -17,7 +26,7 @@ if head=`git rev-parse --verify HEAD 2>/dev/null`; then
 		v="$v"-dirty
 	fi
 else
-	v="$VERSION"
+	v="$VERSION$SUFFIX"
 fi
 
 echo "const char rfkill_version[] = \"$v\";" > "$OUT"
-- 
1.6.5

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux