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 100d0d046c

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 acba8886e4

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 <ijc@docker.com>
This commit is contained in:
Ian Campbell 2018-04-25 10:42:31 +01:00
parent 3ebd1769e2
commit 4320c3928f

View File

@ -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"