From 10dd307fe1962d48277cd1797f5e929a7d1a58ae Mon Sep 17 00:00:00 2001 From: Salvador Fuentes Date: Wed, 19 Jun 2019 12:37:01 -0500 Subject: [PATCH] static-build: qemu: use tag if version doesn't exist Use the tag of qemu from `versions.yaml` instead of the version number if the version does not exist in references of the repository. Fixes: #587. Signed-off-by: Salvador Fuentes --- static-build/qemu/build-static-qemu.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/static-build/qemu/build-static-qemu.sh b/static-build/qemu/build-static-qemu.sh index eae0d4163..0c1bfccbf 100755 --- a/static-build/qemu/build-static-qemu.sh +++ b/static-build/qemu/build-static-qemu.sh @@ -26,6 +26,9 @@ fi [ -n "$qemu_repo" ] || die "failed to get qemu repo" [ -n "$qemu_version" ] || qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu.version") +if ! (git ls-remote --heads "${qemu_url}" | grep -q "refs/heads/${qemu_version}"); then + qemu_version=$(get_from_kata_deps "assets.hypervisor.qemu.tag") +fi [ -n "$qemu_version" ] || die "failed to get qemu version" info "Build ${qemu_repo} version: ${qemu_version}"