From 157e4b2ac2dffa0adebcffe60a8cf0447e05339c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20=27sil2100=27=20Zemczak?= Date: Wed, 31 May 2023 15:08:35 +0200 Subject: [PATCH] Better support for ubuntu-image artifact handling. --- live-build/auto/build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/live-build/auto/build b/live-build/auto/build index 7b9106a3..b71c8942 100755 --- a/live-build/auto/build +++ b/live-build/auto/build @@ -115,8 +115,14 @@ if [ "${IMAGEFORMAT:-}" = "ubuntu-image" ]; then # to tweak livecd-rootfs everytime a different type of artifact # is needed. for artifact in output/*; do - mv $artifact $PREFIX.$(basename $artifact) + # We want to be dynamic, and want to support even + # two-part extensions. + filename=$(basename $artifact) + noversion=$(echo $filename | sed 's/[0-9][0-9]\.[0-9][0-9]//') + extension=${noversion#*.} + mv $artifact "$PREFIX".$extension done + [ -f $PREFIX.img ] && xz -0 -T4 "$PREFIX".img fi exit 0