From 4320c3928f37cd486be8e608d584b9fb97d90be8 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Wed, 25 Apr 2018 10:42:31 +0100 Subject: [PATCH] update-component-sha.sh: support update of image with tagged release. This updates to support updating things like `linuxkit/runc:v0.3` to a new hash (or tag). Running: ./scripts/update-component-sha.sh --image linuxkit/runc 100d0d046c5061d75ee43e4ac5017a759109cae4 Still DTRT and updates runc to that (bogus) sha. Furthermore, running: ./scripts/update-component-sha.sh --image linuxkit/runc v0.4 Updates runc to that (bogus) release (this worked before) but now running: ./scripts/update-component-sha.sh --image linuxkit/runc acba8886e4b1318457c711700f695a02fef9493d Inverts things and puts them back. (this is not quote a nop because src/cmd/linuxkit/vendor/github.com/moby/tool/src/moby/linuxkit.go has a different sha in it which is not put back) Signed-off-by: Ian Campbell --- scripts/update-component-sha.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-component-sha.sh b/scripts/update-component-sha.sh index 5b41ae760..a71303d0f 100755 --- a/scripts/update-component-sha.sh +++ b/scripts/update-component-sha.sh @@ -69,7 +69,7 @@ case "$1" in hash=$3 ;; esac - git grep -E -l "\b$image:" | xargs sed -i.bak -E -e "s,$image:[[:xdigit:]]{40},$image:$hash,g" + git grep -E -l "\b$image:" | xargs sed -i.bak -E -e "s,$image:([[:xdigit:]]{40}|v[0-9\.]+),$image:$hash,g" ;; *) echo "Unknown mode $1"