Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package obs-service-docker_label_helper for 
openSUSE:Factory checked in at 2022-07-25 16:59:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/obs-service-docker_label_helper (Old)
 and      /work/SRC/openSUSE:Factory/.obs-service-docker_label_helper.new.1533 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "obs-service-docker_label_helper"

Mon Jul 25 16:59:48 2022 rev:4 rq:990549 version:0.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/obs-service-docker_label_helper/obs-service-docker_label_helper.changes
  2021-12-16 02:01:27.215651821 +0100
+++ 
/work/SRC/openSUSE:Factory/.obs-service-docker_label_helper.new.1533/obs-service-docker_label_helper.changes
        2022-07-25 16:59:51.081383782 +0200
@@ -1,0 +2,6 @@
+Thu Jul 21 12:50:28 UTC 2022 - Fabian Vogt <[email protected]>
+
+- Avoid mangling whitespace by using gsub instead of assigning to
+  fields
+
+-------------------------------------------------------------------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ obs-service-docker_label_helper.spec ++++++
--- /var/tmp/diff_new_pack.CWbBA4/_old  2022-07-25 16:59:51.533314245 +0200
+++ /var/tmp/diff_new_pack.CWbBA4/_new  2022-07-25 16:59:51.541313014 +0200
@@ -1,7 +1,7 @@
 #
 # spec file for package obs-service-docker_label_helper
 #
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed

++++++ docker_label_helper ++++++
--- /var/tmp/diff_new_pack.CWbBA4/_old  2022-07-25 16:59:51.585306246 +0200
+++ /var/tmp/diff_new_pack.CWbBA4/_new  2022-07-25 16:59:51.589305630 +0200
@@ -19,9 +19,10 @@
        fi
 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]; $1 = "LABEL" }
+    labelprefix != "" && match($0, /^(PREFIXED)?LABEL .*\.([^.]*)=(.*)$/, m) { 
printf "LABEL %s.%s=%s\n", labelprefix, m[2], m[3]; gsub(/^PREFIXEDLABEL/, 
"LABEL") }
     match($0, /^# endlabelprefix/) { labelprefix=""; next }
     1' Dockerfile
 

++++++ test.sh ++++++
--- /var/tmp/diff_new_pack.CWbBA4/_old  2022-07-25 16:59:51.613301938 +0200
+++ /var/tmp/diff_new_pack.CWbBA4/_new  2022-07-25 16:59:51.617301322 +0200
@@ -10,18 +10,21 @@
 # Test old syntax
 cat >Dockerfile <<EOF
 # labelprefix=org.opensuse.nano
-PREFIXEDLABEL org.opencontainers.image.title="Example container"
+PREFIXEDLABEL org.opencontainers.image.title="Example container."
 PREFIXEDLABEL org.opencontainers.image.description="This contains nano"
+PREFIXEDLABEL test.whitespace="Two  spaces. One        tab."
 EOF
 
 export BUILD_DIST=
 sh "${script}"
 
 diff -u Dockerfile - <<EOF
-LABEL org.opensuse.nano.title="Example container"
-LABEL org.opencontainers.image.title="Example container"
+LABEL org.opensuse.nano.title="Example container."
+LABEL org.opencontainers.image.title="Example container."
 LABEL org.opensuse.nano.description="This contains nano"
 LABEL org.opencontainers.image.description="This contains nano"
+LABEL org.opensuse.nano.whitespace="Two  spaces. One   tab."
+LABEL test.whitespace="Two  spaces. One        tab."
 EOF
 
 rm -f Dockerfile
@@ -29,8 +32,9 @@
 # Test new syntax
 cat >Dockerfile <<EOF
 # labelprefix=org.opensuse.nano
-LABEL org.opencontainers.image.title="Example container"
+LABEL org.opencontainers.image.title="Example container."
 LABEL org.opencontainers.image.description="This contains nano"
+LABEL test.whitespace="Two  spaces. One        tab."
 # endlabelprefix
 LABEL not.expanded.label="example"
 EOF
@@ -39,10 +43,12 @@
 sh "${script}"
 
 diff -u Dockerfile - <<EOF
-LABEL org.opensuse.nano.title="Example container"
-LABEL org.opencontainers.image.title="Example container"
+LABEL org.opensuse.nano.title="Example container."
+LABEL org.opencontainers.image.title="Example container."
 LABEL org.opensuse.nano.description="This contains nano"
 LABEL org.opencontainers.image.description="This contains nano"
+LABEL org.opensuse.nano.whitespace="Two  spaces. One   tab."
+LABEL test.whitespace="Two  spaces. One        tab."
 LABEL not.expanded.label="example"
 EOF
 

Reply via email to