[PATCH 2/3] GIT-VERSION-GEN: tweak processing of version file

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

 



- check for version file with "test -r"
- read version file using shell builtin "read" rather than "cat"

Signed-off-by: Mathias Lafeldt <misfire@xxxxxxxxxxx>
---
 GIT-VERSION-GEN |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index 73d5cf9..427d5d6 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -8,9 +8,9 @@ LF='
 
 # First see if there is a version file (included in release tarballs),
 # then try git-describe, then default.
-if test -f version
+if test -r version
 then
-	VN=$(cat version) || VN="$DEF_VER"
+	read VN 2>/dev/null < version || VN="$DEF_VER"
 elif test -d .git -o -f .git &&
 	VN=$(git describe --match "v[0-9]*" --abbrev=4 --dirty 2>/dev/null) &&
 	case "$VN" in
-- 
1.7.3.2

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


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]