From 81f8a91d705b32faf81488833e0862a9e70142f8 Mon Sep 17 00:00:00 2001 From: Avi Deitcher Date: Mon, 4 Mar 2024 15:45:23 +0200 Subject: [PATCH] ensure kernel replacement matches middle of line too Signed-off-by: Avi Deitcher --- kernel/Makefile | 2 +- scripts/update-component-sha.sh | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/kernel/Makefile b/kernel/Makefile index b163f1056..685f322b1 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -201,7 +201,7 @@ update-kernel-hash-yaml-%: # find and replace any usage of the normal kernel with semver for most recent series update-kernel-semver-yaml-%: $(eval NEWTAG=linuxkit/kernel:$*) - $(eval OLDTAG=linuxkit/kernel:[0-9]+.[0-9]+.[0-9]+$$$$) + $(eval OLDTAG=linuxkit/kernel:[0-9]+.[0-9]+.[0-9]+) @cd $(REPO_ROOT) && ./scripts/update-component-sha.sh --hash "$(OLDTAG)" "$(NEWTAG)" # update-kernel-yamls updates the latest hash for each supported series, diff --git a/scripts/update-component-sha.sh b/scripts/update-component-sha.sh index 52e021de7..a65c62e52 100755 --- a/scripts/update-component-sha.sh +++ b/scripts/update-component-sha.sh @@ -69,8 +69,7 @@ case "${mode}" in fi old=$1 new=$2 - - git grep -E -l "\b$old\b" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,$old,$new,g" "$file"; done + git grep -E -l "\b($old)([[:space:]].*)?$" -- '*.yml' '*.yaml' '*.yml.in' '*.yaml.in' '*/Dockerfile' '*/Makefile' | grep -v /vendor/ | while read -r file; do sed -ri.bak -e "s,$old,$new,g" "$file"; done ;; --image) if [ $# -lt 1 ] ; then