[PATCH 5/5] build-sys: fix "remove the g in git describe"

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

 



From: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>

The "g" was not always removed and "-rc*" follow-ups were handled
incorrectly.

So now after last commits we have these versions:

 git describe            -> blkid -V
 --------------------------------------------------------------
 v2.29-rc4               -> 2.29-rc4          (libblkid 2.29.0)
 v2.29-rc4-3-g4c8928d    -> 2.29-rc4-3-4c89   (libblkid 2.29.0)

 v2.29                   -> 2.29              (libblkid 2.29.0)
 v2.29-78-g4c8928d       -> 2.29.78-4c89      (libblkid 2.29.78)

 v2.29.1                 -> 2.29.1            (libblkid 2.29.1)
 v2.29.1-4-g4c8928d      -> 2.29.1.4-4c89     (libblkid 2.29.1)

 v2.29.1-rc2             -> 2.29.1-rc2        (libblkid 2.29.1)
 v2.29.1-rc2-3-g4c8928d  -> 2.29.1-rc2-3-4c89 (libblkid 2.29.1)

Signed-off-by: Ruediger Meier <ruediger.meier@xxxxxxxxxxx>
---
 tools/git-version-gen | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/tools/git-version-gen b/tools/git-version-gen
index 3e431ef..e7249f9 100755
--- a/tools/git-version-gen
+++ b/tools/git-version-gen
@@ -112,16 +112,16 @@ elif test "`git log -1 --pretty=format:x . 2>&1`" = x \
        esac
 then
 
+    # Remove the "g" in git describe's output string, to save a byte.
+    v=${v/-g/-}
+
     case $v in
-        *-rc[0-9])
-	    # Remove the "g" in git describe's output string, to save a byte.
-            v=`echo "$v" | sed 's/\(.*\)-g/\1-/'`;     
-	    ;;
+        *-rc*)
+            ;;
         *)
-	    # Change the first '-' to a '.', so version-comparing tools work properly.
-	    # Remove the "g" in git describe's output string, to save a byte.
-	    v=`echo "$v" | sed 's/-/./;s/\(.*\)-g/\1-/'`;
-	    ;;
+            # Change the first '-' to a '.', so version-comparing tools work properly.
+            v=`echo "$v" | sed 's/-/./'`;
+            ;;
     esac
     v_from_git=1
 else
-- 
1.8.5.6

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



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux