From: Felipe Contreras Date: Fri, 14 Apr 2023 12:18:28 GMT Subject: [PATCH 05/18] version-gen: simplify update check Message-ID: <20230414121841.373980-6-felipe.contreras@gmail.com> In-Reply-To: <20230414121841.373980-1-felipe.contreras@gmail.com> We don't need to extract the version when we can compare the whole contents. Signed-off-by: Felipe Contreras --- 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