diff --git a/docker_label_helper b/docker_label_helper index c8c5d84..7ee51d1 100644 --- a/docker_label_helper +++ b/docker_label_helper @@ -22,6 +22,6 @@ fi # Note: Avoid assigning to $1 etc. as that converts whitespace (field separators) to single spaces. gawk -i inplace ' match($0, /^# labelprefix=(.*)$/, m) { labelprefix=m[1]; next } - labelprefix != "" && match($0, /^(PREFIXED)?LABEL .*\.([^.]*)=(.*)$/, m) { printf "LABEL %s.%s=%s\n", labelprefix, m[2], m[3]; gsub(/^PREFIXEDLABEL/, "LABEL") } + 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 diff --git a/obs-service-docker_label_helper.changes b/obs-service-docker_label_helper.changes index 8b99c1c..3e7d118 100644 --- a/obs-service-docker_label_helper.changes +++ b/obs-service-docker_label_helper.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 1 07:54:19 UTC 2023 - Fabian Vogt + +- Handle LABEL statements with any whitespace +- Handle LABEL values containing "=" properly + ------------------------------------------------------------------- Wed Dec 7 09:48:52 UTC 2022 - Dominique Leuenberger diff --git a/obs-service-docker_label_helper.spec b/obs-service-docker_label_helper.spec index 48ea673..e53ed5e 100644 --- a/obs-service-docker_label_helper.spec +++ b/obs-service-docker_label_helper.spec @@ -1,7 +1,7 @@ # # spec file for package obs-service-docker_label_helper # -# Copyright (c) 2022 SUSE LLC +# Copyright (c) 2023 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed diff --git a/test.sh b/test.sh index ffe4c45..ea207c9 100644 --- a/test.sh +++ b/test.sh @@ -12,7 +12,8 @@ cat >Dockerfile <Dockerfile <