From 3073a8095f86d9a2b5bdd83905d7d87dd8d941d4986990ae3d69abd7dbf740b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Thu, 3 Oct 2024 17:41:02 +0200 Subject: [PATCH] Sync from SUSE:SLFO:Main obs-service-docker_label_helper revision aaa909addea4b68d3143ac9c83073f33 --- docker_label_helper | 10 ++++--- obs-service-docker_label_helper.changes | 5 ++++ test.sh | 39 +++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 4 deletions(-) diff --git a/docker_label_helper b/docker_label_helper index 7ee51d1..3f98753 100644 --- a/docker_label_helper +++ b/docker_label_helper @@ -1,6 +1,8 @@ #!/bin/bash set -eu +file="Dockerfile" + if [ "${BUILD_DIST+x}" != "x" ]; then echo "Not running in an OBS build container" exit 1 @@ -11,10 +13,10 @@ if [ -e "${BUILD_DATA}" ]; then . "${BUILD_DATA}" # The build script renames the recipe (to strip _service:foo:), but doesn't update .data - RECIPEFILE="${RECIPEFILE##*:}" + file="${RECIPEFILE##*:}" - if [ "${RECIPEFILE}" != "Dockerfile" ]; then - echo "Recipe is not a Dockerfile - exiting" + if [[ ! "${file}" =~ ^Dockerfile.* ]]; then + echo "Recipe ${file} is not a Dockerfile - exiting" exit 0 fi fi @@ -24,4 +26,4 @@ gawk -i inplace ' match($0, /^# labelprefix=(.*)$/, m) { labelprefix=m[1]; next } labelprefix != "" && match($0, /^(PREFIXED)?LABEL[[:space:]]+[^=]*\.([^.=]*)=(.*)$/, m) { printf "LABEL %s.%s=%s\n", labelprefix, m[2], m[3]; gsub(/^PREFIXEDLABEL/, "LABEL") } match($0, /^# endlabelprefix/) { labelprefix=""; next } - 1' Dockerfile + 1' "${file}" \ No newline at end of file diff --git a/obs-service-docker_label_helper.changes b/obs-service-docker_label_helper.changes index 3e7d118..52c5d49 100644 --- a/obs-service-docker_label_helper.changes +++ b/obs-service-docker_label_helper.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 7 08:31:35 UTC 2024 - Andrea Mazzotti + +- Support Docker.FLAVOR in _multibuild (boo#1225985) + ------------------------------------------------------------------- Wed Mar 1 07:54:19 UTC 2023 - Fabian Vogt diff --git a/test.sh b/test.sh index ea207c9..d747abb 100644 --- a/test.sh +++ b/test.sh @@ -57,3 +57,42 @@ LABEL org.opensuse.nano.whitespace="Two spaces. One tab." LABEL test.whitespace="Two spaces. One tab." LABEL not.expanded.label="example" EOF + +# Test _multibuild +cat >Dockerfile.FLAVOR <"$tmpdir/test_multibuild/.build/build.data" <NotADockerfile <"$tmpdir/test_multibuild/.build/build.data" <