We don't need to extract the version when we can compare the whole contents. Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx> --- GIT-VERSION-GEN | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) 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 -- 2.40.0+fc1