[PATCH 4/8] Escape dots in version string before grep-ing.

Cristian Ionescu-Idbohrn cristian.ionescu-idbohrn at axis.com
Sun May 12 02:50:00 PDT 2013


Less false positives that way.

Signed-off-by: Cristian Ionescu-Idbohrn <cristian.ionescu-idbohrn at axis.com>
---
 scripts/check-version |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/scripts/check-version b/scripts/check-version
index ab98211..f036fe2 100755
--- a/scripts/check-version
+++ b/scripts/check-version
@@ -64,10 +64,20 @@ case $v in
 		;;
 esac

+saveIFS=$IFS
+IFS=.
+set -- $v
+IFS=$saveIFS
+v=
+while [ $# -gt 0 ]; do
+	v=${v:+$v\\.}$1
+	shift
+done
+
 sts=0
 whine "checking for version $v"
 for f in $files; do
-	grep $opts -EHio "(VERSION=|subsurface[[:blank:]]+)?\<v?$v\>" $f || {
+	grep $opts -EHio "(VERSION=|subsurface[[:blank:]]+)?\<v?$v[.0-9]*\>" $f || {
 		[ $release != y ] || sts=1
 		whine "'$f' may need updating"
 	}
-- 
1.7.10.4



More information about the subsurface mailing list