From 6e45f4bfe2d09dffa9d9b97acfe1fef7a33324d1 Mon Sep 17 00:00:00 2001 From: Tibor Vass Date: Tue, 13 Apr 2021 16:12:01 +0000 Subject: [PATCH] scripts: fix VERSION_QUAD corner case in windows resource When the git checkout is dirty on top of a git tag (i.e., v20.10.6.m), the VERSION_QUAD was keeping a trailing comma. Now the trailing comma is stripped. Signed-off-by: Tibor Vass --- scripts/build/binary | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build/binary b/scripts/build/binary index e4c5e12a6b..c44c2a9cbe 100755 --- a/scripts/build/binary +++ b/scripts/build/binary @@ -56,7 +56,7 @@ fi if [ "$(go env GOOS)" = "windows" ]; then # Generate a Windows file version of the form major,minor,patch,build - VERSION_QUAD=$(printf "%s" "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | tr . , | sed -re 's/^[0-9]+$/\0,0/' | sed -re 's/^[0-9]+,[0-9]+$/\0,0/' | sed -re 's/^[0-9]+,[0-9]+,[0-9]+$/\0,0/') + VERSION_QUAD=$(printf "%s" "$VERSION" | sed -re 's/^([0-9.]*).*$/\1/' | tr . , | sed -re 's/,$//' | sed -re 's/^[0-9]+$/\0,0/' | sed -re 's/^[0-9]+,[0-9]+$/\0,0/' | sed -re 's/^[0-9]+,[0-9]+,[0-9]+$/\0,0/') set -- [ -n "$VERSION" ] && set -- "$@" -D "DOCKER_VERSION=\"$VERSION\""