From: Stefan Hajnoczi <stefa...@redhat.com> Personal repos may not have release tags (v6.0.0, v6.1.0, etc) and this causes cross_system_build_job to fail when pretty-printing a unique qemu-setup-*.exe name:
version="$(git describe --match v[0-9]*)"; ^^^^^^^^^^ fails ^^^^^^^^^^^ mv -v qemu-setup*.exe qemu-setup-${version}.exe; Fall back to the short commit hash if necessary. This fixes CI failures that Greg Kurz and I experienced in our personal repos. Cc: Greg Kurz <gr...@kaod.org> Cc: Gerd Hoffmann <kra...@redhat.com> Cc: Philippe Mathieu-Daudé <phi...@redhat.com> Signed-off-by: Stefan Hajnoczi <stefa...@redhat.com> Reviewed-by: Greg Kurz <gr...@kaod.org> Reviewed-by: Thomas Huth <th...@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Message-Id: <20220125173454.10381-1-stefa...@redhat.com> Signed-off-by: Alex Bennée <alex.ben...@linaro.org> Message-Id: <20220204204335.1689602-14-alex.ben...@linaro.org> diff --git a/.gitlab-ci.d/crossbuild-template.yml b/.gitlab-ci.d/crossbuild-template.yml index 10d22dcf6c..29c3c2b826 100644 --- a/.gitlab-ci.d/crossbuild-template.yml +++ b/.gitlab-ci.d/crossbuild-template.yml @@ -14,7 +14,7 @@ - make -j$(expr $(nproc) + 1) all check-build $MAKE_CHECK_ARGS - if grep -q "EXESUF=.exe" config-host.mak; then make installer; - version="$(git describe --match v[0-9]*)"; + version="$(git describe --match v[0-9]* 2>/dev/null || git rev-parse --short HEAD)"; mv -v qemu-setup*.exe qemu-setup-${version}.exe; fi -- 2.30.2