diff mbox series

[05/18] version-gen: simplify update check

Message ID 20230414121841.373980-6-felipe.contreras@gmail.com (mailing list archive)
State Superseded
Headers show
Series [01/18] version-gen: reorganize | expand

Commit Message

Felipe Contreras April 14, 2023, 12:18 p.m. UTC
We don't need to extract the version when we can compare the whole
contents.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
---
 GIT-VERSION-GEN | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/GIT-VERSION-GEN b/GIT-VERSION-GEN
index c0f6bb242f..34f561752b 100755
--- a/GIT-VERSION-GEN
+++ b/GIT-VERSION-GEN
@@ -35,11 +35,5 @@  fi
 
 VN=${VN#v}
 
-if test -r $GVF
-then
-	VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
-else
-	VC='unset'
-fi
-test "$VN" = "$VC" && exit
+test -r $GVF && test "GIT_VERSION = $VN" = "$(cat $GVF)" && exit
 echo "GIT_VERSION = $VN" | tee $GVF >&2