Hello community,

here is the log from the commit of package singularity for openSUSE:Factory 
checked in at 2019-07-22 12:20:23
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/singularity (Old)
 and      /work/SRC/openSUSE:Factory/.singularity.new.4126 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "singularity"

Mon Jul 22 12:20:23 2019 rev:11 rq:717250 version:3.2.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/singularity/singularity.changes  2019-05-16 
22:08:30.090366518 +0200
+++ /work/SRC/openSUSE:Factory/.singularity.new.4126/singularity.changes        
2019-07-22 12:20:25.251663888 +0200
@@ -2 +2 @@
-Wed May 15 14:18:54 UTC 2019 - Egbert Eich <e...@suse.com>
+Sat Jul 20 18:20:40 UTC 2019 - Egbert Eich <e...@suse.com>
@@ -4 +4,2 @@
-- Fix a typo in the SUSE Integration.
+- Fix-pgp-key-version-strings-and-paths.patch
+  Fixing pgp key, version strings and paths.
@@ -7 +8 @@
-Sun Apr 28 06:32:08 UTC 2019 - Egbert Eich <e...@suse.com>
+Tue Jun 11 14:49:00 UTC 2019 - Egbert Eich <e...@suse.com>
@@ -9,23 +10,119 @@
-- Improve support for openSUSE/SLE Singularity image creation:
-  * Add-support-for-SLE.patch
-    Add support for SLE.
-  * Create-chroot-only-after-settings-have-been-verified.patch
-    Create chroot only after settings have been verified.
-  * Don-t-hard-code-OS-version-if-non-is-specified.patch
-    Don't hard code OS version if non is specified.
-  * Handle-zypper-error-code-correctly.patch
-    Do not consider installation scriptlet failures an installation
-    failure.
-  * Support-multi-line-bootdef-settings.patch
-    If lines are separated by a '\' in a bootdef setting definition
-    concatenate them. If the characters before the trailing '\' are
-    '\n', replace by a newline.
-  * 
When-writing-a-file-to-the-container-unlink-if-it-exists-as-link-or-directory.patch
-    If a link or a directory exists with the same name as a file to
-    be written to the container, remove it before writing the the file.
-    Removing a link avoids issues if the link target cannot be written
-    to.
-  * Update README.SUSE: Describe bootdef variables.
-- Fix rpmlint warning:
-  * api.py-Remove-shbang-not-meant-for-direct-execution.patch
-    Remove shbang - not meant for direct execution.
+- Update to version 3.2.1:
+  This point release fixes the following bugs:
+  * Allows users to join instances with non-suid workflow
+  * Removes false warning when seccomp is disabled on the host
+  * Fixes an issue in the terminal when piping output to commands
+  * Binds NVIDIA persistenced socket when `--nv` is invoked
+
+-------------------------------------------------------------------
+Thu Jun  6 14:10:47 UTC 2019 - Egbert Eich <e...@suse.com>
+
+- Improve integration with SUSE Products: add support to create
+  Singularity images with SLE.
+  * build-position-independent-binaries.patch:
+    Make sure, the built binaries adhere to the packaging guidelines.
+  * zypper-install-Fix-dbpath-for-newer-versions-of-SUSE-Linux.patch:
+    Newer SUSE versions use a different path for the RPM database.
+  * Handle-zypper-error-code-correctly.patch:
+    When the installation succeeds by an installation scriptlet fails
+    zypper returns error code 107. Don't treat this as an error.
+  * Support-multi-line-bootdef-settings.patch:
+    In order to specify a repository GPG key, add support for
+    multi line variables.
+  * Add-support-for-numbered-variables.patch:
+    In order to specify a list of additional repos, add support
+    to 'indexed' variables.
+  * Improve-zypper-integration.patch:
+    Improve handling of SUSE repositires:
+    - For SLE, use SUSEConnect to get all product repos.
+    - Allow to specify a repository GPG key.
+    - Allow to specify additional installation repositories.
+  * Add-unit-tests-for-zypper-installation-on-SLE.patch
+    Add unit tests.
+
+-------------------------------------------------------------------
+Sat May 18 15:42:45 UTC 2019 - Egbert Eich <e...@suse.com>
+
+- Add group 'singularity', fix ownerships.
+
+-------------------------------------------------------------------
+Thu May 16 07:03:34 UTC 2019 - Egbert Eich <e...@suse.com>
+
+- Updated to singularity v3.2.0
+   * [Security related 
fix](https://cve.mitre.org/cgi-bin/cvename.cgi?name=2019-11328)
+     Instance files are now stored in user's home directory for privacy and
+     many checks have been added to ensure that a user can't manipulate files
+     to change `starter-suid` behavior when instances are joined (many thanks
+     to Matthias Gerstner from the SUSE security team for finding and securely
+     reporting this vulnerability)
+     (CVE-2019-11328, bsc#1128598)
+   * New features / functionalities
+     - Introduced a new basic framework for creating and managing plugins
+     - Added the ability to create containers through multi-stage builds
+     - Created the concept of a Sylabs Cloud "remote" endpoint and added the
+       ability for users and admins to set them through CLI and conf files 
+     - Added caching for images from Singularity Hub
+     - Made it possible to compile Singularity outside of `$GOPATH`
+     - Added a json partition to SIF files for OCI configuration when building
+       from an OCI source
+     - Full integration with Singularity desktop for MacOS code base
+   * New Commands
+     - Introduced the `plugin` command group for creating and managing plugins.
+   * Introduced the `remote` command group to support management of Singularity
+     endpoints.
+   * Added to the `key` command group to improve PGP key management.
+   * Added the `Stage: <name>` keyword to the definition file header and the
+     `from <stage name>` option/argument pair to the `%files` section to
+     support multistage builds
+   * Deprecated / removed commands
+     - The `--token/-t` option has been deprecated in favor of the `singularity
+       remote` command group
+   * Changed defaults / behaviors
+     - Ask to confirm password on a newly generated PGP key
+     - Prompt to push a key to the KeyStore when generated
+     - Refuse to push an unsigned container unless overridden with
+       `--allow-unauthenticated/-U` option
+     - Warn and prompt when pulling an unsigned container without the
+       `--allow-unauthenticated/-U` option
+  For more information check:
+     https://github.com/sylabs/singularity/blob/release-3.2/CHANGELOG.md
+- Updated build-position-independent-binaries.patch
+
+-------------------------------------------------------------------
+Tue Apr  9 09:59:13 UTC 2019 - Christian Goll <cg...@suse.com>
+
+- building now non stripped version 
+
+-------------------------------------------------------------------
+Thu Apr  4 12:24:12 UTC 2019 - Christian Goll <cg...@suse.com>
+
+- updated to singularity v3.1.1
+  * New Commands
+    - New hidden `buildcfg` command to display compile-time parameters 
+    - Added support for `LDFLAGS`, `CFLAGS`, `CGO_` variables in build system
+    - Added `--nocolor` flag to Singularity client to disable color in logging
+  * Removed Commands
+    `singularity capability <add/drop> --desc` has been removed
+    `singularity capability list <--all/--group/--user>` flags have all
+    been removed 
+  * New features / functionalities
+    - The `--builder` flag to the `build` command implicitly sets `--remote`
+    - Repeated binds no longer cause Singularity to exit and fail, just warn
+      instead
+    - Corrected typos and improved docstrings throughout
+    - Removed warning when CWD does not exist on the host system
+    - Added support to spec file for RPM building on SLES 11
+
+-------------------------------------------------------------------
+Wed Mar  6 10:07:37 UTC 2019 - Christian Goll <cg...@suse.com>
+
+- update to singularity 3.1.0 what is reimplementaion in go
+  so this is a complete new build and just reusing the changelog
+  entries, following build differences were made to the upstream
+  spec file
+  * build position independent executable
+  * build stripped executable
+  * added following files: 
+   * build_flags.patch what adds the right build flags
+   * singularity-rpmlintrc which supresses warning of file duplicate 
+     badness dues to different setuid bit

Old:
----
  Add-support-for-SLE.patch
  Create-chroot-only-after-settings-have-been-verified.patch
  Don-t-hard-code-OS-version-if-non-is-specified.patch
  
When-writing-a-file-to-the-container-unlink-if-it-exists-as-link-or-directory.patch
  _service
  api.py-Remove-shbang-not-meant-for-direct-execution.patch
  singularity-2.6.1.tar.gz

New:
----
  Add-support-for-numbered-variables.patch
  Add-unit-tests-for-zypper-installation-on-SLE.patch
  Fix-pgp-key-version-strings-and-paths.patch
  Improve-zypper-integration.patch
  build-position-independent-binaries.patch
  singularity-3.2.1.tar.gz

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

Other differences:
------------------
++++++ singularity.spec ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:25.923663712 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:25.923663712 +0200
@@ -16,188 +16,169 @@
 #
 
 
-#
-%define libsingularity libsingularity1
-
-%define git_version 2.6.1
-
-# slurm build broken
-%define have_slurm 0
-
-%define allow_suid 1
+%define singgopath src/github.com/sylabs/
+%define _buildshell /bin/bash
 
-# for the perl git file parser to run, none of the 
-# macros used in the variables must contain shell code.
-%define github_ref %{?git_sha}%{!?git_sha:%git_version}
-
-Name:           singularity
-Version:        %git_version
-Release:        0
 Summary:        Application and environment virtualization
-License:        BSD-3-Clause
+License:        BSD-3-Clause-LBNL
 Group:          Productivity/Clustering/Computing
-Url:            http://singularity.lbl.gov/
-#Source:               
https://github.com/singularityware/%%{name}/tarball/%%{github_ref}#/%%{name}-%%{version}.tar.gz
-Source:         
https://github.com/singularityware/%{name}/archive/%{github_ref}.tar.gz#/%{name}-%{version}.tar.gz
+Name:           singularity
+Version:        3.2.1
+Release:        0
+# https://spdx.org/licenses/BSD-3-Clause-LBNL.html
+URL:            https://www.sylabs.io/singularity/
+Source0:        
https://github.com/sylabs/singularity/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
 Source1:        README.SUSE
-Source5:        singularity-rpmlintrc
+Source5:        %{name}-rpmlintrc
+Patch0:         build-position-independent-binaries.patch
 Patch1:         
zypper-install-Fix-dbpath-for-newer-versions-of-SUSE-Linux.patch
 Patch2:         Handle-zypper-error-code-correctly.patch
-Patch3:         
When-writing-a-file-to-the-container-unlink-if-it-exists-as-link-or-directory.patch
-Patch4:         Support-multi-line-bootdef-settings.patch
-Patch5:         api.py-Remove-shbang-not-meant-for-direct-execution.patch
-Patch6:         Add-support-for-SLE.patch
-Patch7:         Don-t-hard-code-OS-version-if-non-is-specified.patch
-Patch8:         Create-chroot-only-after-settings-have-been-verified.patch
-
-BuildRequires:  autoconf
-BuildRequires:  automake
-BuildRequires:  libtool
-%if 0%{?have_slurm}
-BuildRequires:  slurm-devel
+Patch3:         Support-multi-line-bootdef-settings.patch
+Patch4:         Add-support-for-numbered-variables.patch
+Patch5:         Improve-zypper-integration.patch
+Patch6:         Add-unit-tests-for-zypper-installation-on-SLE.patch
+Patch7:         Fix-pgp-key-version-strings-and-paths.patch
+
+BuildRequires:  gcc
+# Remove after brokenness has been fixed
+%if 0%{?suse_version} > 1500
+BuildRequires:  go >= 1.11
+%else
+BuildRequires:  go1.11
 %endif
 BuildRequires:  fdupes
-BuildRequires:  libarchive-devel
-BuildRequires:  python
-%{?allow_suid:Requires(pre):  shadow}
-%if 0%{?sle_version} >= 120200 && 0%{?sle_version} < 150000
-# On SLE 12 there is no way to check if the proper version has
-# been installed. Trust that the user has done updates.
-PreReq:         permissions
-%else
-PreReq:         permissions >= 20170922
+BuildRequires:  git
+BuildRequires:  libuuid-devel
+BuildRequires:  make
+BuildRequires:  openssl-devel
+%ifarch aarch64
+BuildRequires:  binutils-gold
 %endif
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+Requires:       squashfs
+PreReq:         permissions
+
+# there's no golang for ppc64, just ppc64le
+ExcludeArch:    ppc64
+
+Provides:       %{name}-runtime
 
 %description
-Singularity provides functionality to build the smallest most minimal
-possible containers, and running those containers as single application
-environments.
-
-%package devel
-Summary:        Development package for Singularity
-Group:          Development/Libraries/C and C++
-Requires:       %{libsingularity} = %{version}
-Requires:       %{name} = %{version}
-
-%description devel
-Development package for singularity. This package includes the header files
-and libraries for the Singularity API.
-
-%package -n %{libsingularity}
-Summary:        Libraries for Singularity
-Group:          System/Libraries
-
-%description -n %{libsingularity}
-This package contains the library needed to run programs dynamically linked
-with Singularity.
+Singularity provides functionality to make portable
+containers that can be used across host environments.
+
 
 %prep
-%setup -q -n %{name}-%{github_ref}
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
-%patch6 -p1
-%patch7 -p1
-%patch8 -p1
+%setup -q -n gopath/%{singgopath} -c
+mv %{name}-%{version} %{name}
+%patch0 -p 4
+%patch1 -p 4
+%patch2 -p 4
+%patch3 -p 4
+%patch4 -p 4
+%patch5 -p 4
+%patch6 -p 4
+%patch7 -p 4
 cp %{S:1} .
 
 %build
-./autogen.sh
-%configure \
+export GOPATH=$PWD/gopath
+export PATH=$GOPATH/bin:$PATH
+cd %{name}
+
+# Not all of these parameters currently have an effect, but they might be
+#  used someday.  They are the same parameters as in the configure macro.
+./mconfig -V %{version}-%{release} \
+        -P release \
+        --prefix=%{_prefix} \
+        --exec-prefix=%{_exec_prefix} \
+        --bindir=%{_bindir} \
+        --sbindir=%{_sbindir} \
+        --sysconfdir=%{_sysconfdir} \
+        --datadir=%{_datadir} \
+        --includedir=%{_includedir} \
+        --libdir=%{_libdir} \
+        --libexecdir=%{_libexecdir} \
    --localstatedir=%{_localstatedir}/lib \
-    %{!?allow_suid:--disable-suid} \
-    --with-userns \
-    --with-gnu-ld \
-%if 0%{?have_slurm}
-    --with-slurm
-%endif
-
-make %{?_smp_mflags} CFLAGS+=-fPIE LDFLAGS+=-pie
+        --sharedstatedir=%{_sharedstatedir} \
+        --mandir=%{_mandir} \
+        --infodir=%{_infodir}
+cd builddir
+make V="" old_config=
 
 %install
-%makeinstall
-# remove static library stuff
-rm -f %{buildroot}/%{_libdir}/%{name}/lib%{name}-*.a
-rm -f %{buildroot}/%{_libdir}/%{name}/lib%{name}-*.la
-# fix broken permissions
-chmod a-x %{buildroot}/%{_libexecdir}/%{name}/python/docker/__init__.py
-chmod a-x %{buildroot}/%{_libexecdir}/%{name}/python/__init__.py
-mkdir -p %{buildroot}/%{_datadir}/bash-completion/completions/
-mv %{buildroot}/%{_sysconfdir}/bash_completion.d/%{name} \
-    %{buildroot}/%{_datadir}/bash-completion/completions/%{name}
-sed -i -e '/#\!/d' %{buildroot}/%{_datadir}/bash-completion/completions/%{name}
-for file in $(find %{buildroot}/%{_libexecdir} -name \*.py); do grep 
"/usr/bin/env" $file && sed -i 's@/usr/bin/env python@/usr/bin/python@' $file; 
done
-%fdupes  %{buildroot}
-
-%post -n %{libsingularity} -p /sbin/ldconfig
+export GOPATH=$PWD/gopath
+export PATH=$GOPATH/bin:$PATH
+cd %{name}/builddir
+
+mkdir -p $RPM_BUILD_ROOT%{_mandir}/man1
+make DESTDIR=$RPM_BUILD_ROOT install man
+chmod 644 $RPM_BUILD_ROOT%{_sysconfdir}/singularity/actions/*
+# move bash completion to the right place
+mkdir -pv %{buildroot}/%{_datadir}/bash-completion/completions/
+mv %{buildroot}/%{_sysconfdir}/bash_completion.d/singularity \
+       %{buildroot}/%{_datadir}/bash-completion/completions/
+cd ../..
+%fdupes singularity/examples
+mkdir -p .tmp
+for j in LICENSE.md LICENSE; do
+    for i in `find . -name $j`; do
+       k="`basename ${i/%\/$j/-$j}`"
+       if ! [[ $k =~ singularity-.* ]]; then
+           cp $i .tmp/$k
+       fi
+    done
+done
+%fdupes -s .tmp
+mv .tmp/* .
+rmdir .tmp
 
-%postun -n %{libsingularity} -p /sbin/ldconfig
-
-%if 0%{allow_suid:1}
 %pre 
-getent group %{name} >/dev/null || groupadd -r %{name}
+getent group singularity >/dev/null || groupadd -r singularity
 exit 0
 
 %post
-%set_permissions %{_libexecdir}/%{name}/bin/expand-suid
-%set_permissions %{_libexecdir}/%{name}/bin/mount-suid
-%set_permissions %{_libexecdir}/%{name}/bin/create-suid
-%set_permissions %{_libexecdir}/%{name}/bin/action-suid
-%set_permissions %{_libexecdir}/%{name}/bin/export-suid
-%set_permissions %{_libexecdir}/%{name}/bin/import-suid
-%set_permissions %{_libexecdir}/%{name}/bin/start-suid
+%set_permissions %{_libexecdir}/singularity/bin/starter-suid
 
 %verifyscript
-%verify_permissions %{_libexecdir}/%{name}/bin/expand-suid
-%verify_permissions %{_libexecdir}/%{name}/bin/mount-suid
-%verify_permissions %{_libexecdir}/%{name}/bin/create-suid
-%verify_permissions %{_libexecdir}/%{name}/bin/action-suid
-%verify_permissions %{_libexecdir}/%{name}/bin/export-suid
-%verify_permissions %{_libexecdir}/%{name}/bin/import-suid
-%set_permissions %{_libexecdir}/%{name}/bin/start-suid
-%endif
-
-%if 0%{?sle_version} > 120200 || 0%{?suse_version} > 1320
-%define files_license %license 
-%else 
-%define files_license %doc 
-%endif
+%set_permissions %{_libexecdir}/singularity/bin/starter-suid
 
 %files
-%defattr(-,root,root)
-%doc examples CONTRIBUTING.md README.md %{basename:%{S:1}}
-%doc CONTRIBUTORS.md CHANGELOG.md LICENSE-LBNL.md
-%files_license COPYRIGHT.md LICENSE.md
-%attr(0755,root,root) %dir %{_sysconfdir}/%{name}
-%config(noreplace) %{_sysconfdir}/%{name}/default-nsswitch.conf
-%config(noreplace) %{_sysconfdir}/%{name}/init
-%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
-%config(noreplace) %{_sysconfdir}/%{name}/nvliblist.conf
-%if 0%{?suse_version} < 1500
-%dir %{_datadir}/bash-completion
-%dir %{_datadir}/bash-completion/completions
-%endif
-%{_datadir}/bash-completion/completions/%{name}
-%{_bindir}/%{name}
-%{_bindir}/run-%{name}
-%{_libexecdir}/%{name}
-%exclude %{_libdir}/%{name}/lib%{name}-*.so*
-%{?allow_suid:%verify(not mode) %attr(4750,root,%{name}) 
%{_libexecdir}/%{name}/bin/*-suid}
-%{_mandir}/man1/%{name}.1.gz
-%{_localstatedir}/lib/%{name}
-
-%files -n %{libsingularity}
-%defattr(-,root,root)
-%dir %{_libdir}/%{name}
-%{_libdir}/%{name}/lib%{name}-*.so.*
-
-%files devel
-%defattr(-,root,root)
-%dir /usr/include/%{name}
-/usr/include/%{name}/*.h
-%{_libdir}/%{name}/lib%{name}-*.so
+%doc singularity/examples
+%doc singularity/CONTRIBUTING.md
+%doc singularity/README.md
+%doc singularity/CHANGELOG.md
+%doc singularity/CONTRIBUTORS.md
+%doc %{basename:%{S:1}}
+%license singularity/LICENSE-LBNL.md
+%license singularity/COPYRIGHT.md
+%license singularity/LICENSE.md
+%license *-LICENSE.md *-LICENSE
+%attr(4750, root, singularity) %{_libexecdir}/singularity/bin/starter-suid
+%{_bindir}/*
+%dir %{_libexecdir}/singularity
+%dir %{_libexecdir}/singularity/bin
+%dir %{_libexecdir}/singularity/cni
+%{_libexecdir}/singularity/bin/starter
+%{_libexecdir}/singularity/cni/*
+%dir %{_sysconfdir}/singularity
+%dir %{_sysconfdir}/singularity/actions/
+%config(noreplace) %attr(755, root, singularity) 
%{_sysconfdir}/singularity/actions/exec
+%config(noreplace) %attr(755, root, singularity) 
%{_sysconfdir}/singularity/actions/run
+%config(noreplace) %attr(755, root, singularity) 
%{_sysconfdir}/singularity/actions/shell
+%config(noreplace) %attr(755, root, singularity) 
%{_sysconfdir}/singularity/actions/start
+%config(noreplace) %attr(755, root, singularity) 
%{_sysconfdir}/singularity/actions/test
+%config(noreplace) %{_sysconfdir}/singularity/capability.json
+%config(noreplace) %{_sysconfdir}/singularity/cgroups
+%config(noreplace) %{_sysconfdir}/singularity/ecl.toml
+%config(noreplace) %{_sysconfdir}/singularity/network
+%config(noreplace) %{_sysconfdir}/singularity/nvliblist.conf
+%config(noreplace) %{_sysconfdir}/singularity/seccomp-profiles
+%config(noreplace) %{_sysconfdir}/singularity/singularity.conf
+%config(noreplace) %{_sysconfdir}/singularity/remote.yaml
+%{_datadir}/bash-completion/completions/singularity
+%dir %{_localstatedir}/lib/singularity
+%dir %{_localstatedir}/lib/singularity/mnt
+%dir %{_localstatedir}/lib/singularity/mnt/session
+%{_mandir}/man1/*
 
 %changelog

++++++ Add-support-for-numbered-variables.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Thu Jun 6 21:18:26 2019 +0200
Subject: Add support for numbered variables
Patch-mainline: Not yet
Git-commit: e0306cf0f44468290cfe7f46f31da6102baa4884
References: 

To use multipe instances of the same variable, introduced 'numbered
variables' (sort of like an array).
In the validHeaders table, these variables are
represented by an '&n' attached to their name:
ie:
    "foo&n": true,
this will match variables of the form:
foo0: somestring
in the definition file. The value can be referenced from
the Header map using "foo0" as key.

Signed-off-by: Egbert Eich <e...@suse.com>
---
 .../sylabs/singularity/pkg/build/types/parser/deffile.go   | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
index b490831..a3cc040 100644
--- a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
+++ b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
@@ -337,6 +337,7 @@ func doHeader(h string, d *types.Definition) (err error) {
        cont_key, cont_val := "", ""
 
        for _, line := range toks {
+               var key, val string = "", ""
                // skip empty or comment lines
                if line = strings.TrimSpace(line); line == "" || 
strings.Index(line, "#") == 0 {
                        if len(cont_key) > 0 {
@@ -354,9 +355,9 @@ func doHeader(h string, d *types.Definition) (err error) {
                                return fmt.Errorf("header key %s had no val", 
linetoks[0])
                        }
 
-                       key, val := 
strings.ToLower(strings.TrimSpace(linetoks[0])), strings.TrimSpace(linetoks[1])
+                       key, val = 
strings.ToLower(strings.TrimSpace(linetoks[0])), strings.TrimSpace(linetoks[1])
                } else {
-                       key, val := cont_key, cont_val + 
strings.TrimSpace(trimLine)
+                       key, val = cont_key, cont_val + 
strings.TrimSpace(trimLine)
                        cont_key, cont_val = "", ""
                }
                // continuation
@@ -369,7 +370,14 @@ func doHeader(h string, d *types.Definition) (err error) {
                        continue
                }
                if _, ok := validHeaders[key]; !ok {
-                       return fmt.Errorf("invalid header keyword found: %s", 
key)
+                       rgx := regexp.MustCompile(`\d+$`)
+                       tmp_key := rgx.ReplaceAllString(key, "&n")
+                       if ok = tmp_key != key; ok {
+                               _, ok = validHeaders[tmp_key]
+                       }
+                       if !ok {
+                               return fmt.Errorf("invalid header keyword 
found: %s", key)
+                       }
                }
                header[key] = val
        }
++++++ Add-unit-tests-for-zypper-installation-on-SLE.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Tue Jun 11 14:33:26 2019 +0200
Subject: Add unit tests for zypper installation on SLE
Patch-mainline: Not yet
Git-commit: 02dfbd741a35a45ee0f1ad81c1541f4d7341fe5c
References: 

Signed-off-by: Egbert Eich <e...@suse.com>
---
 .../pkg/build/types/parser/deffile_test.go         |  2 +
 .../types/parser/testdata_good/zypper_sle/zypper   | 30 ++++++++++
 .../parser/testdata_good/zypper_sle/zypper.json    | 65 ++++++++++++++++++++++
 .../testdata_good/zypper_sle/zypper_sections.json  |  8 +++
 4 files changed, 105 insertions(+)
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile_test.go 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile_test.go
index 2608ff3..4cb2701 100644
--- a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile_test.go
+++ b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile_test.go
@@ -34,6 +34,7 @@ func TestScanDefinitionFile(t *testing.T) {
                {"Shub", "testdata_good/shub/shub", 
"testdata_good/shub/shub_sections.json"},
                {"Yum", "testdata_good/yum/yum", 
"testdata_good/yum/yum_sections.json"},
                {"Zypper", "testdata_good/zypper/zypper", 
"testdata_good/zypper/zypper_sections.json"},
+               {"Zypper_SLE", "testdata_good/zypper_sle/zypper", 
"testdata_good/zypper_sle/zypper_sections.json"},
        }
 
        for _, tt := range tests {
@@ -173,6 +174,7 @@ func TestParseDefinitionFile(t *testing.T) {
                {"Shub", "testdata_good/shub/shub", 
"testdata_good/shub/shub.json"},
                {"Yum", "testdata_good/yum/yum", "testdata_good/yum/yum.json"},
                {"Zypper", "testdata_good/zypper/zypper", 
"testdata_good/zypper/zypper.json"},
+               {"Zypper_SLE", "testdata_good/zypper_sle/zypper", 
"testdata_good/zypper_sle/zypper.json"},
                {"NoHeader", "testdata_good/noheader/noheader", 
"testdata_good/noheader/noheader.json"},
                {"NoHeaderComments", 
"testdata_good/noheadercomments/noheadercomments", 
"testdata_good/noheadercomments/noheadercomments.json"},
                {"NoHeaderWhiteSpace", 
"testdata_good/noheaderwhitespace/noheaderwhitespace", 
"testdata_good/noheaderwhitespace/noheaderwhitespace.json"},
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper
 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper
new file mode 100644
index 0000000..51903dd
--- /dev/null
+++ 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper
@@ -0,0 +1,30 @@
+Bootstrap: zypper
+OSVersion: 15.1
+MirrorURL: ftp://example.org/SLE-15-SP1-Installer-DVD-x86_64-GM-DVD1
+Product: SLE_HPC/%{OSVERSION}/x86_64
+User: t...@user.org
+Regcode: REG-CODE-1a2b3c
+RegisterUrl: https://scc.suse.com
+ProductPGP: -----BEGIN PGP PUBLIC KEY BLOCK-----\n\
+Version: rpm-4.11.2 (NSS-3)\n\
+\n\
+mQENBFEKlmsBCADbpZZbbSC5Zi+HxCR/ynYsVxU5JNNiSSZabN5GMgc9Z0hxeXxp\n\
+YWvFoE/4n0+IXIsp83iKvxf06Eu8je/DXp0lMqDZu7WiT3XXAlkOPSNV4akHTDoY\n\
+91SJaZCpgUJ7K1QXOPABNbREsAMN1a7rxBowjNjBUyiTJ2YuvQRLtGdK1kExsVma\n\
+hieh/QxpoDyYd5w/aky3z23erCoEd+OPfAqEHd5tQIa6LOosa63BSCEl3milJ7J9\n\
+vDmoGPAoS6ui7S2R5X4/+PLN8Mm2kOBrFjhmL93LX0mrGCMxsNsKgP6zabYKQEb8\n\
+L028SXvl7EGoA+Vw5Vd3wIGbM73PfbgNrXjfABEBAAG0KFN1U0UgUGFja2FnZSBT\n\
+aWduaW5nIEtleSA8YnVpbGRAc3VzZS5kZT6JATwEEwECACYCGwMGCwkIBwMCBBUC\n\
+CAMEFgIDAQIeAQIXgAUCWEfrHwUJDsIitAAKCRBwr56BOdt8gpqUB/wPSSS5BcDu\n\
+Oi4n02cj4Hdt7WITKBjjo0lG1fXG1ppx1wOST+s8FertMVFY53TW6FGjcYtwVOIq\n\
+rsMYiV6kf1NxUV/jcAy7VmC5EZnO0R/D3sT4Oh5hsLtERauZolK5BZmd0S51Qa8e\n\
+TxZ5mX9PL2i3s/ShETc30drf83ugc7B4yZPNQWXNDPgGcC+hEeC5qw48RzHYIpUt\n\
+RzHmefR5Z3ioTUbDlzy+SGP2uA7mhR4Lfk/df5fYxWfCoKlyGjtrvA65cB+Pksyn\n\
+xrAeBuB+vBM+KnDrxW2Sn4AbWkzH//dfz9OJDJu4UM91hb7qxM0OkrXHQV3iNqzg\n\
+MDEhky/9NqMy\n\
+=GdP5\n\
+-----END PGP PUBLIC KEY BLOCK-----
+Modules: sle-module-basesystem,sle-module-hpc
+Otherurl0: https://download.example.org/repositories/project1/SLE_15_SP1
+Otherurl1: https://download.example.org/repositories/project2/SLE_15_SP1
+Include: somepackage
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper.json
 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper.json
new file mode 100644
index 0000000..e5146b9
--- /dev/null
+++ 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper.json
@@ -0,0 +1,65 @@
+{
+       "header": {
+               "bootstrap": "zypper",
+               "include": "somepackage",
+               "mirrorurl": 
"ftp://example.org/SLE-15-SP1-Installer-DVD-x86_64-GM-DVD1";,
+               "modules": "sle-module-basesystem,sle-module-hpc",
+               "osversion": "15.1",
+               "otherurl0": 
"https://download.example.org/repositories/project1/SLE_15_SP1";,
+               "otherurl1": 
"https://download.example.org/repositories/project2/SLE_15_SP1";,
+               "product": "SLE_HPC/%{OSVERSION}/x86_64",
+               "regcode": "REG-CODE-1a2b3c",
+               "registerurl": "https://scc.suse.com";,
+               "productpgp": "-----BEGIN PGP PUBLIC KEY BLOCK-----\nVersion: 
rpm-4.11.2 
(NSS-3)\n\nmQENBFEKlmsBCADbpZZbbSC5Zi+HxCR/ynYsVxU5JNNiSSZabN5GMgc9Z0hxeXxp\nYWvFoE/4n0+IXIsp83iKvxf06Eu8je/DXp0lMqDZu7WiT3XXAlkOPSNV4akHTDoY\n91SJaZCpgUJ7K1QXOPABNbREsAMN1a7rxBowjNjBUyiTJ2YuvQRLtGdK1kExsVma\nhieh/QxpoDyYd5w/aky3z23erCoEd+OPfAqEHd5tQIa6LOosa63BSCEl3milJ7J9\nvDmoGPAoS6ui7S2R5X4/+PLN8Mm2kOBrFjhmL93LX0mrGCMxsNsKgP6zabYKQEb8\nL028SXvl7EGoA+Vw5Vd3wIGbM73PfbgNrXjfABEBAAG0KFN1U0UgUGFja2FnZSBT\naWduaW5nIEtleSA8YnVpbGRAc3VzZS5kZT6JATwEEwECACYCGwMGCwkIBwMCBBUC\nCAMEFgIDAQIeAQIXgAUCWEfrHwUJDsIitAAKCRBwr56BOdt8gpqUB/wPSSS5BcDu\nOi4n02cj4Hdt7WITKBjjo0lG1fXG1ppx1wOST+s8FertMVFY53TW6FGjcYtwVOIq\nrsMYiV6kf1NxUV/jcAy7VmC5EZnO0R/D3sT4Oh5hsLtERauZolK5BZmd0S51Qa8e\nTxZ5mX9PL2i3s/ShETc30drf83ugc7B4yZPNQWXNDPgGcC+hEeC5qw48RzHYIpUt\nRzHmefR5Z3ioTUbDlzy+SGP2uA7mhR4Lfk/df5fYxWfCoKlyGjtrvA65cB+Pksyn\nxrAeBuB+vBM+KnDrxW2Sn4AbWkzH//dfz9OJDJu4UM91hb7qxM0OkrXHQV3iNqzg\nMDEhky/9NqMy\n=GdP5\n-----END
 PGP PUBLIC KEY BLOCK-----",
+               "user": "t...@user.org"
+       },
+       "imageData": {
+               "metadata": null,
+               "labels": {},
+               "imageScripts": {
+                       "help": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "environment": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "runScript": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "test": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "startScript": {
+                               "args": "",
+                               "script": ""
+                       }
+               }
+       },
+       "buildData": {
+               "files": [],
+               "buildScripts": {
+                       "pre": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "setup": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "post": {
+                               "args": "",
+                               "script": ""
+                       },
+                       "test": {
+                               "args": "",
+                               "script": ""
+                       }
+               }
+       },
+       "customData": null,
+       "raw": 
"Qm9vdHN0cmFwOiB6eXBwZXIKT1NWZXJzaW9uOiAxNS4xCk1pcnJvclVSTDogZnRwOi8vZXhhbXBsZS5vcmcvU0xFLTE1LVNQMS1JbnN0YWxsZXItRFZELXg4Nl82NC1HTS1EVkQxClByb2R1Y3Q6IFNMRV9IUEMvJXtPU1ZFUlNJT059L3g4Nl82NApVc2VyOiB0ZXN0QHVzZXIub3JnClJlZ2NvZGU6IFJFRy1DT0RFLTFhMmIzYwpSZWdpc3RlclVybDogaHR0cHM6Ly9zY2Muc3VzZS5jb20KUHJvZHVjdFBHUDogLS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tXG5cClZlcnNpb246IHJwbS00LjExLjIgKE5TUy0zKVxuXApcblwKbVFFTkJGRUtsbXNCQ0FEYnBaWmJiU0M1WmkrSHhDUi95bllzVnhVNUpOTmlTU1phYk41R01nYzlaMGh4ZVh4cFxuXApZV3ZGb0UvNG4wK0lYSXNwODNpS3Z4ZjA2RXU4amUvRFhwMGxNcURadTdXaVQzWFhBbGtPUFNOVjRha0hURG9ZXG5cCjkxU0phWkNwZ1VKN0sxUVhPUEFCTmJSRXNBTU4xYTdyeEJvd2pOakJVeWlUSjJZdXZRUkx0R2RLMWtFeHNWbWFcblwKaGllaC9ReHBvRHlZZDV3L2FreTN6MjNlckNvRWQrT1BmQXFFSGQ1dFFJYTZMT29zYTYzQlNDRWwzbWlsSjdKOVxuXAp2RG1vR1BBb1M2dWk3UzJSNVg0LytQTE44TW0ya09CckZqaG1MOTNMWDBtckdDTXhzTnNLZ1A2emFiWUtRRWI4XG5cCkwwMjhTWHZsN0VHb0ErVnc1VmQzd0lHYk03M1BmYmdOclhqZkFCRUJBQUcwS0ZOMVUwVWdVR0ZqYTJGblpTQlRcblwKYVdkdWFXNW5JRXRsZVNBOFluVnBiR1JBYzNWelpTNWtaVDZKQVR3RUV3RUNBQ1lDR3dNR0N3a0lCd01DQkJVQ1xuXApDQU1FRmdJREFRSWVBUUlYZ0FVQ1dFZnJId1VKRHNJaXRBQUtDUkJ3cjU2Qk9kdDhncHFVQi93UFNTUzVCY0R1XG5cCk9pNG4wMmNqNEhkdDdXSVRLQmpqbzBsRzFmWEcxcHB4MXdPU1QrczhGZXJ0TVZGWTUzVFc2RkdqY1l0d1ZPSXFcblwKcnNNWWlWNmtmMU54VVYvamNBeTdWbUM1RVpuTzBSL0Qzc1Q0T2g1aHNMdEVSYXVab2xLNUJabWQwUzUxUWE4ZVxuXApUeFo1bVg5UEwyaTNzL1NoRVRjMzBkcmY4M3VnYzdCNHlaUE5RV1hORFBnR2NDK2hFZUM1cXc0OFJ6SFlJcFV0XG5cClJ6SG1lZlI1WjNpb1RVYkRsenkrU0dQMnVBN21oUjRMZmsvZGY1Zll4V2ZDb0tseUdqdHJ2QTY1Y0IrUGtzeW5cblwKeHJBZUJ1Qit2Qk0rS25EcnhXMlNuNEFiV2t6SC8vZGZ6OU9KREp1NFVNOTFoYjdxeE0wT2tyWEhRVjNpTnF6Z1xuXApNREVoa3kvOU5xTXlcblwKPUdkUDVcblwKLS0tLS1FTkQgUEdQIFBVQkxJQyBLRVkgQkxPQ0stLS0tLQpNb2R1bGVzOiBzbGUtbW9kdWxlLWJhc2VzeXN0ZW0sc2xlLW1vZHVsZS1ocGMKT3RoZXJ1cmwwOiBodHRwczovL2Rvd25sb2FkLmV4YW1wbGUub3JnL3JlcG9zaXRvcmllcy9wcm9qZWN0MS9TTEVfMTVfU1AxCk90aGVydXJsMTogaHR0cHM6Ly9kb3dubG9hZC5leGFtcGxlLm9yZy9yZXBvc2l0b3JpZXMvcHJvamVjdDIvU0xFXzE1X1NQMQpJbmNsdWRlOiBzb21lcGFja2FnZQo="
+}
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper_sections.json
 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper_sections.json
new file mode 100644
index 0000000..f6e1fbe
--- /dev/null
+++ 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/testdata_good/zypper_sle/zypper_sections.json
@@ -0,0 +1,8 @@
+[
+   {
+      "Header":"Bootstrap: zypper\nOSVersion: 15.1\nMirrorURL: 
ftp://example.org/SLE-15-SP1-Installer-DVD-x86_64-GM-DVD1\nProduct: 
SLE_HPC/%{OSVERSION}/x86_64\nUser: t...@user.org\nRegcode: 
REG-CODE-1a2b3c\nRegisterUrl: https://scc.suse.com\nProductPGP: -----BEGIN PGP 
PUBLIC KEY BLOCK-----\\n\\\nVersion: rpm-4.11.2 
(NSS-3)\\n\\\n\\n\\\nmQENBFEKlmsBCADbpZZbbSC5Zi+HxCR/ynYsVxU5JNNiSSZabN5GMgc9Z0hxeXxp\\n\\\nYWvFoE/4n0+IXIsp83iKvxf06Eu8je/DXp0lMqDZu7WiT3XXAlkOPSNV4akHTDoY\\n\\\n91SJaZCpgUJ7K1QXOPABNbREsAMN1a7rxBowjNjBUyiTJ2YuvQRLtGdK1kExsVma\\n\\\nhieh/QxpoDyYd5w/aky3z23erCoEd+OPfAqEHd5tQIa6LOosa63BSCEl3milJ7J9\\n\\\nvDmoGPAoS6ui7S2R5X4/+PLN8Mm2kOBrFjhmL93LX0mrGCMxsNsKgP6zabYKQEb8\\n\\\nL028SXvl7EGoA+Vw5Vd3wIGbM73PfbgNrXjfABEBAAG0KFN1U0UgUGFja2FnZSBT\\n\\\naWduaW5nIEtleSA8YnVpbGRAc3VzZS5kZT6JATwEEwECACYCGwMGCwkIBwMCBBUC\\n\\\nCAMEFgIDAQIeAQIXgAUCWEfrHwUJDsIitAAKCRBwr56BOdt8gpqUB/wPSSS5BcDu\\n\\\nOi4n02cj4Hdt7WITKBjjo0lG1fXG1ppx1wOST+s8FertMVFY53TW6FGjcYtwVOIq\\n\\\nrsMYiV6kf1NxUV/jcAy7VmC5EZnO0R/D3sT4Oh5hsLtERauZolK5BZmd0S51Qa8e\\n\\\nTxZ5mX9PL2i3s/ShETc30drf83ugc7B4yZPNQWXNDPgGcC+hEeC5qw48RzHYIpUt\\n\\\nRzHmefR5Z3ioTUbDlzy+SGP2uA7mhR4Lfk/df5fYxWfCoKlyGjtrvA65cB+Pksyn\\n\\\nxrAeBuB+vBM+KnDrxW2Sn4AbWkzH//dfz9OJDJu4UM91hb7qxM0OkrXHQV3iNqzg\\n\\\nMDEhky/9NqMy\\n\\\n=GdP5\\n\\\n-----END
 PGP PUBLIC KEY BLOCK-----\nModules: 
sle-module-basesystem,sle-module-hpc\nOtherurl0: 
https://download.example.org/repositories/project1/SLE_15_SP1\nOtherurl1: 
https://download.example.org/repositories/project2/SLE_15_SP1\nInclude: 
somepackage\n"
+   }
+]
+
+
+
++++++ Fix-pgp-key-version-strings-and-paths.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Sat Jul 20 20:18:44 2019 +0200
Subject: Fix pgp key, version strings and paths
Patch-mainline: Not yet
Git-commit: 8ac7056c81a54971a8d92ed998762c57b1d217d7
References: 

Signed-off-by: Egbert Eich <e...@suse.com>
---
 .../internal/pkg/build/sources/conveyorPacker_zypper.go        | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff --git 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
index b8aef97..ffb085b 100644
--- 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+++ 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
@@ -144,7 +144,7 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                        return fmt.Errorf("Cannot convert minor version string 
to integer: %v", err)
                }
                if len(array) > 1 && tmp > 0 {
-                       osservicepack = array[1]
+                       osservicepack = "." + array[1]
                }
                if mirrorurl_ok {
                        mirrorurl = regex.ReplaceAllString(mirrorurl, osmajor + 
osservicepack)
@@ -173,7 +173,7 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                        }
                        pgpfile = tmpfile.Name();
 
-                       if _, err = tmpfile.WriteString(slepgp); err != nil {
+                       if _, err = tmpfile.WriteString(slepgp + "\n"); err != 
nil {
                                return fmt.Errorf("Cannot write pgp-file: 
%v\n", err)
                        }
                        if err = tmpfile.Close(); err != nil {
@@ -245,16 +245,16 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                                rpmsys = "/usr/lib/sysimage"
                                rpmrel = "../../.."
                }
-               if err = os.MkdirAll(cp.b.Rootfs() + rpmbase + `rpm`, 0755); 
err != nil {
+               if err = os.MkdirAll(cp.b.Rootfs() + rpmbase + `/rpm`, 0755); 
err != nil {
                        return fmt.Errorf("Cannot recreate rpm directories: 
%v\n", err)
                }
                if err = os.MkdirAll(cp.b.Rootfs() + rpmsys, 0755); err != nil {
                        return fmt.Errorf("Cannot recreate rpm directories: 
%v\n", err)
                }
-               if err = os.RemoveAll(cp.b.Rootfs() + rpmsys + `rpm`); err != 
nil {
+               if err = os.RemoveAll(cp.b.Rootfs() + rpmsys + `/rpm`); err != 
nil {
                        return fmt.Errorf("Cannot remove rpm directory")
                }
-               if err = os.Symlink(rpmrel + rpmbase, cp.b.Rootfs() + rpmsys + 
`rpm`); err != nil {
+               if err = os.Symlink(rpmrel + rpmbase + `/rpm`, cp.b.Rootfs() + 
rpmsys + `/rpm`); err != nil {
                        return fmt.Errorf("Cannot create rpm symlink")
                }
                cmd := exec.Command("rpmkeys", `--root`, cp.b.Rootfs(), 
`--import`, pgpfile)
++++++ Handle-zypper-error-code-correctly.patch ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:25.959663703 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:25.959663703 +0200
@@ -1,37 +1,31 @@
 From: Egbert Eich <e...@suse.com>
-Date: Wed Nov 21 21:02:12 2018 +0100
+Date: Mon May 13 16:52:11 2019 +0200
 Subject: Handle zypper error code correctly
 Patch-mainline: Not yet
-Git-commit: d416e74f7b9184e24ed36366f87fc7ccf555fd46
+Git-commit: 0fbc15393d0f615ef6ad2e70837430817ab72992
 References: 
 
-Do not consider installation scriptlet failures an installation
+Do not consider installation scriptlet failures as an installation
 failure.
 
 Signed-off-by: Egbert Eich <e...@suse.com>
 ---
- .../libexec/bootstrap-scripts/deffile-driver-zypper.sh       | 12 ++++++++----
- 1 file changed, 8 insertions(+), 4 deletions(-)
-diff --git 
a/singularity-2.6.0/libexec/bootstrap-scripts/deffile-driver-zypper.sh 
b/singularity-2.6.0/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-index 1f8252d..3052a52 100644
---- a/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-+++ b/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-@@ -120,10 +120,14 @@ $INSTALL_CMD --root $SINGULARITY_ROOTFS ar $MIRROR 
repo-oss
- $INSTALL_CMD --root $SINGULARITY_ROOTFS --gpg-auto-import-keys refresh
+ .../singularity/internal/pkg/build/sources/conveyorPacker_zypper.go | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+diff --git 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+index 0e6f00a..d08d61d 100644
+--- 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
++++ 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+@@ -113,7 +113,11 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
  
- # Do the install!
--if ! eval "$INSTALL_CMD -c $SINGULARITY_ROOTFS/$ZYPP_CONF --root 
$SINGULARITY_ROOTFS --releasever=${OSVERSION} -n install 
--auto-agree-with-licenses aaa_base ${INCLUDE:-}"; then
--    message ERROR "Bootstrap failed... exiting\n"
--    ABORT 255
--fi
-+eval "$INSTALL_CMD -c $SINGULARITY_ROOTFS/$ZYPP_CONF --root 
$SINGULARITY_ROOTFS --releasever=${OSVERSION} -n install 
--auto-agree-with-licenses aaa_base ${INCLUDE:-}"
-+ret=$?
-+case $ret in
-+   0) message 1 "Bootstrap succeeded\n" ;;
-+   107) message 1 "Bootstrap succeeded, some RPM scripts failed\n" ;;
-+   *) message ERROR "Bootstrap failed... return code: $ret - exiting\n";
-+   ABORT 255 ;;
-+esac
+       // run zypper
+       if err = cmd.Run(); err != nil {
+-              return fmt.Errorf("While bootstrapping from zypper: %v", err)
++              if ret, _ := system.GetExitCode(err); ret == 107 {
++                     sylog.Warningf("Bootstrap succeeded, some RPM scripts 
failed");
++              } else {
++                     return fmt.Errorf("While bootstrapping from zypper: %v", 
err)
++              }
+       }
  
- if ! eval "rm -rf $SINGULARITY_ROOTFS/var/cache/zypp-bootstrap"; then
-     message WARNING "Failed cleaning Bootstrap packages\n"
+       return nil

++++++ Improve-zypper-integration.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Sat May 18 12:51:21 2019 +0200
Subject: - Improve zypper integration
Patch-mainline: Not yet
Git-commit: 394f27034f220f46d19adef7214ad094272dd568
References: 

Signed-off-by: Egbert Eich <e...@suse.com>
---
 .../pkg/build/sources/conveyorPacker_zypper.go     | 261 ++++++++++++++++++---
 .../singularity/pkg/build/types/parser/deffile.go  |   7 +
 2 files changed, 238 insertions(+), 30 deletions(-)
diff --git 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
index d08d61d..8d472b0 100644
--- 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+++ 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
@@ -16,9 +16,11 @@ import (
        "regexp"
        "runtime"
        "strings"
+       "strconv"
 
        "github.com/sylabs/singularity/internal/pkg/sylog"
        "github.com/sylabs/singularity/pkg/build/types"
+       "github.com/docker/docker/pkg/system"
 )
 
 const (
@@ -30,8 +32,28 @@ type ZypperConveyorPacker struct {
        b *types.Bundle
 }
 
+func machine() (string, error) {
+       var stdout bytes.Buffer
+       unamePath, err := exec.LookPath("uname")
+       if err != nil {
+               return "", err
+       }
+       cmd := exec.Command(unamePath, `-m`)
+       cmd.Stdout = &stdout
+       cmd.Stderr = os.Stderr
+       if err = cmd.Run(); err != nil {
+               return "", err
+       }
+       return stdout.String(), err
+}
+
 // Get downloads container information from the specified source
 func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err error) {
+        var suseconnectProduct, suseconnectModver string = "", ""
+       var suseconnectPath string = ""
+       var pgpfile string = ""
+       var iosmajor int
+       var otherurl [20]string
        cp.b = b
 
        // check for zypper on system
@@ -46,23 +68,6 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                return
        }
 
-       // get mirrorURL, OSVerison, and Includes components to definition
-       mirrorurl, ok := cp.b.Recipe.Header["mirrorurl"]
-       if !ok {
-               return fmt.Errorf("Invalid zypper header, no MirrorURL 
specified")
-       }
-
-       // look for an OS version if the mirror specifies it
-       osversion := ""
-       regex := regexp.MustCompile(`(?i)%{OSVERSION}`)
-       if regex.MatchString(mirrorurl) {
-               osversion, ok = cp.b.Recipe.Header["osversion"]
-               if !ok {
-                       return fmt.Errorf("Invalid zypper header, OSVersion 
referenced in mirror but no OSVersion specified")
-               }
-               mirrorurl = regex.ReplaceAllString(mirrorurl, osversion)
-       }
-
        include := cp.b.Recipe.Header["include"]
 
        // check for include environment variable and add it to requires string
@@ -74,6 +79,124 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
        // add aaa_base to start of include list by default
        include = `aaa_base ` + include
 
+       // get mirrorURL, OSVerison, and Includes components to definition
+       osversion, osversion_ok := cp.b.Recipe.Header["osversion"]
+       mirrorurl, mirrorurl_ok := cp.b.Recipe.Header["mirrorurl"]
+       updateurl, updateurl_ok := cp.b.Recipe.Header["updateurl"]
+       sleproduct, sleproduct_ok := cp.b.Recipe.Header["product"]
+       sleuser, sleuser_ok := cp.b.Recipe.Header["user"]
+       sleregcode, sleregcode_ok := cp.b.Recipe.Header["regcode"]
+       slepgp, slepgp_ok := cp.b.Recipe.Header["productpgp"]
+       sleurl, sleurl_ok := cp.b.Recipe.Header["registerurl"]
+       slemodules, slemodules_ok := cp.b.Recipe.Header["modules"]
+       cnt := -1
+       if tmp, ok := cp.b.Recipe.Header["otherurl0"]; ok {
+               otherurl[0] = tmp
+               cnt = 1
+       } else {
+               if tmp, ok := cp.b.Recipe.Header["otherurl1"]; ok {
+                       otherurl[0] = tmp
+                       cnt = 2
+               }
+       }
+       for i := 1; cnt > 0 && i < 20; i++ {
+               numS := strconv.Itoa(cnt)
+               if tmp, ok := cp.b.Recipe.Header["otherurl" + numS]; ok {
+                       otherurl[i] = tmp
+                       cnt ++
+               } else {
+                       cnt = -1
+               }
+       }
+       regex := regexp.MustCompile(`(?i)%{OSVERSION}`)
+
+       if sleproduct_ok || sleuser_ok || sleregcode_ok {
+               if !sleproduct_ok || !sleuser_ok || !sleregcode_ok {
+                       return fmt.Errorf("For installation of SLE 'Product', 
'User' and 'Regcode' need to be set\n")
+               }
+               if !osversion_ok {
+                       return fmt.Errorf("Invalid zypper header, OSVersion 
always required for SLE")
+               }
+               if !slepgp_ok && !mirrorurl_ok {
+                       return fmt.Errorf("No 'SLEpgp' and no 'InstallURL' 
defined in bootstrap definition\n")
+               }
+               suseconnectPath, err = exec.LookPath("SUSEConnect")
+               if err != nil {
+                       return fmt.Errorf("SUSEConnect is not in PATH: %v", err)
+               }
+
+               array := strings.SplitN(osversion, ".", -1)
+               osmajor := array[0]
+               iosmajor, err = strconv.Atoi(osmajor)
+               if err != nil {
+                       return fmt.Errorf("OSVersion has wrong format %v",err);
+               }
+               osminor := ""
+               if len(array) > 1 {
+                       osminor = "." + array[1]
+               }
+               if iosmajor > 12 && !mirrorurl_ok {
+                       return fmt.Errorf("For SLE version > 12 'MirrorURL' 
must be defined and point to the installer\n")
+               }
+               osservicepack := ""
+               tmp, err := strconv.Atoi(array[1])
+               if err != nil {
+                       return fmt.Errorf("Cannot convert minor version string 
to integer: %v", err)
+               }
+               if len(array) > 1 && tmp > 0 {
+                       osservicepack = array[1]
+               }
+               if mirrorurl_ok {
+                       mirrorurl = regex.ReplaceAllString(mirrorurl, osmajor + 
osservicepack)
+               }
+               sleproduct = regex.ReplaceAllString(sleproduct, osmajor + 
osservicepack)
+               array = strings.SplitN(sleproduct, "/", -1)
+               machine, err := machine()
+               if len(array) == 3 {
+                       machine = array[2]
+               }
+               suseconnectProduct = sleproduct
+               suseconnectModver = osmajor + osminor + "/" + machine
+               switch len(array) {
+                       case 1:
+                       case 2:
+                               suseconnectProduct += "/" + machine
+                       case 3:
+                               suseconnectProduct += "/" + osversion + "/" + 
machine
+                       default:
+                               return fmt.Errorf("Malformed Product 
setting\n");
+               }
+               if (slepgp_ok) {
+                       tmpfile, err := ioutil.TempFile("/tmp", 
"singularity-pgp")
+                       if err != nil {
+                               return fmt.Errorf("Cannot create pgp-file: 
%v\n", err)
+                       }
+                       pgpfile = tmpfile.Name();
+
+                       if _, err = tmpfile.WriteString(slepgp); err != nil {
+                               return fmt.Errorf("Cannot write pgp-file: 
%v\n", err)
+                       }
+                       if err = tmpfile.Close(); err != nil {
+                               return fmt.Errorf("Cannot close pgp-file %v\n", 
err)
+                       }
+               }
+
+               include = include + ` SUSEConnect`
+       } else {
+               if !mirrorurl_ok {
+                       return fmt.Errorf("Invalid zypper header, no MirrorURL 
specified")
+               }
+               if regex.MatchString(mirrorurl) || ( updateurl_ok && 
regex.MatchString(updateurl)) {
+                       if !osversion_ok {
+                               return fmt.Errorf("Invalid zypper header, 
OSVersion referenced in mirror but no OSVersion specified")
+                       }
+                       mirrorurl = regex.ReplaceAllString(mirrorurl, osversion)
+                       if updateurl_ok {
+                               updateurl = regex.ReplaceAllString(updateurl, 
osversion)
+                       }
+               }
+       }
+
        // Create the main portion of zypper config
        err = cp.genZypperConfig()
        if err != nil {
@@ -85,27 +208,105 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                return fmt.Errorf("While copying pseudo devices: %v", err)
        }
 
-       // Add mirrorURL as repo
-       cmd := exec.Command(zypperPath, `--root`, cp.b.Rootfs(), `ar`, 
mirrorurl, `repo-oss`)
-       cmd.Stdout = os.Stdout
-       cmd.Stderr = os.Stderr
-       if err = cmd.Run(); err != nil {
-               return fmt.Errorf("While adding zypper mirror: %v", err)
+       // Add mirrorURL/installURL as repo
+       if mirrorurl != "" {
+               cmd := exec.Command(zypperPath, `--root`, cp.b.Rootfs(), `ar`, 
mirrorurl, `repo`)
+               cmd.Stdout = os.Stdout
+               cmd.Stderr = os.Stderr
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While adding zypper mirror: %v", err)
+               }
+               // Refreshing gpg keys
+               cmd = exec.Command(zypperPath, `--root`, cp.b.Rootfs(), 
`--gpg-auto-import-keys`, `refresh`)
+               cmd.Stdout = os.Stdout
+               cmd.Stderr = os.Stderr
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While refreshing gpg keys: %v", err)
+               }
+               if updateurl != "" {
+                       cmd := exec.Command(zypperPath, `--root`, 
cp.b.Rootfs(), `ar`, `-f`, updateurl, `update`)
+                       cmd.Stdout = os.Stdout
+                       cmd.Stderr = os.Stderr
+                       if err = cmd.Run(); err != nil {
+                               return fmt.Errorf("While adding zypper update: 
%v", err)
+                       }
+               }
+               for i := 0; otherurl[i] != ""; i++ {
+                       sId := strconv.Itoa(i)
+                       cmd := exec.Command(zypperPath, `--root`, 
cp.b.Rootfs(), `ar`, `-f`, otherurl[i], `repo-` + sId)
+                       cmd.Stdout = os.Stdout
+                       cmd.Stderr = os.Stderr
+                       if err = cmd.Run(); err != nil {
+                               return fmt.Errorf("While adding zypper url: %s 
%v", otherurl[i], err)
+                       }
+               }
+       }
+       if pgpfile != "" {
+               rpmbase := "/usr/lib/sysimage"
+               rpmsys := "/var/lib"
+               rpmrel := "../.."
+               if iosmajor == 12 {
+                               rpmbase = "/var/lib"
+                               rpmsys = "/usr/lib/sysimage"
+                               rpmrel = "../../.."
+               }
+               if err = os.MkdirAll(cp.b.Rootfs() + rpmbase + `rpm`, 0755); 
err != nil {
+                       return fmt.Errorf("Cannot recreate rpm directories: 
%v\n", err)
+               }
+               if err = os.MkdirAll(cp.b.Rootfs() + rpmsys, 0755); err != nil {
+                       return fmt.Errorf("Cannot recreate rpm directories: 
%v\n", err)
+               }
+               if err = os.RemoveAll(cp.b.Rootfs() + rpmsys + `rpm`); err != 
nil {
+                       return fmt.Errorf("Cannot remove rpm directory")
+               }
+               if err = os.Symlink(rpmrel + rpmbase, cp.b.Rootfs() + rpmsys + 
`rpm`); err != nil {
+                       return fmt.Errorf("Cannot create rpm symlink")
+               }
+               cmd := exec.Command("rpmkeys", `--root`, cp.b.Rootfs(), 
`--import`, pgpfile)
+               cmd.Stdout = os.Stdout
+               cmd.Stderr = os.Stderr
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While importing pgp keys: %v", err)
+               }
+               if err = os.Remove(pgpfile); err != nil {
+                       return fmt.Errorf("Cannot remove pgpfile")
+               }
        }
 
-       // Refreshing gpg keys
-       cmd = exec.Command(zypperPath, `--root`, cp.b.Rootfs(), 
`--gpg-auto-import-keys`, `refresh`)
-       cmd.Stdout = os.Stdout
-       cmd.Stderr = os.Stderr
-       if err = cmd.Run(); err != nil {
-               return fmt.Errorf("While refreshing gpg keys: %v", err)
+       if suseconnectPath != "" {
+               args := []string{ `--root`, cp.b.Rootfs(),
+                               `--product`, suseconnectProduct,
+                               `--email`, sleuser,
+                               `--regcode`, sleregcode}
+               if sleurl_ok {
+                       args = append(args, `--url`, sleurl)
+               }
+               cmd := exec.Command(suseconnectPath, args...)
+               cmd.Stdout = os.Stdout
+               cmd.Stderr = os.Stderr
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While registering: %v", err)
+               }
+               if (slemodules_ok) {
+                       array := strings.SplitN(slemodules, ",", -1)
+                       for i := 0; i < len(array); i++ {
+                               array[i] = strings.TrimSpace(array[i])
+                               cmd := exec.Command(suseconnectPath, `--root`, 
cp.b.Rootfs(),
+                                       `--product`, array[i] + `/` + 
suseconnectModver)
+                               cmd.Stdout = os.Stdout
+                               cmd.Stderr = os.Stderr
+                               if err = cmd.Run(); err != nil {
+                                       return fmt.Errorf("While registering: 
%v", err)
+                               }
+                       }
+               }
        }
 
        args := []string{`--non-interactive`, `-c`, 
filepath.Join(cp.b.Rootfs(), zypperConf), `--root`, cp.b.Rootfs(), 
`--releasever=` + osversion, `-n`, `install`, `--auto-agree-with-licenses`, 
`--download-in-advance`}
        args = append(args, strings.Fields(include)...)
 
        // Zypper install command
-       cmd = exec.Command(zypperPath, args...)
+       cmd := exec.Command(zypperPath, args...)
        cmd.Stdout = os.Stdout
        cmd.Stderr = os.Stderr
 
diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
index a3cc040..e61091d 100644
--- a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
+++ b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
@@ -550,4 +550,11 @@ var validHeaders = map[string]bool{
        "registry":   true,
        "namespace":  true,
        "stage":      true,
+       "product":      true,
+       "user":         true,
+       "regcode":      true,
+       "productpgp":   true,
+       "registerurl":  true,
+       "modules":      true,
+        "otherurl&n":   true,
 }
diff --git 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
 
b/gopath/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
index ae9e457..b8aef97 100644
--- 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+++ 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
@@ -230,14 +230,9 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                        if err = cmd.Run(); err != nil {
                                return fmt.Errorf("While adding zypper update: 
%v", err)
                        }
-               }
-               for i := 0; otherurl[i] != ""; i++ {
-                       sId := strconv.Itoa(i)
-                       cmd := exec.Command(zypperPath, `--root`, 
cp.b.Rootfs(), `ar`, `-f`, otherurl[i], `repo-` + sId)
-                       cmd.Stdout = os.Stdout
-                       cmd.Stderr = os.Stderr
+                       cmd = exec.Command(zypperPath, `--root`, cp.b.Rootfs(), 
`--gpg-auto-import-keys`, `refresh`, `-r`, `update`)
                        if err = cmd.Run(); err != nil {
-                               return fmt.Errorf("While adding zypper url: %s 
%v", otherurl[i], err)
+                               return fmt.Errorf("While refreshing update %v", 
err)
                        }
                }
        }
@@ -301,6 +296,19 @@ func (cp *ZypperConveyorPacker) Get(b *types.Bundle) (err 
error) {
                        }
                }
        }
+       for i := 0; otherurl[i] != ""; i++ {
+               sId := strconv.Itoa(i)
+               cmd := exec.Command(zypperPath, `--root`, cp.b.Rootfs(), `ar`, 
`-f`, otherurl[i], `repo-` + sId)
+               cmd.Stdout = os.Stdout
+               cmd.Stderr = os.Stderr
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While adding zypper url: %s %v", 
otherurl[i], err)
+               }
+               cmd = exec.Command(zypperPath, `--root`, cp.b.Rootfs(), 
`--gpg-auto-import-keys`, `refresh`, `-r`, `repo-` + sId)
+               if err = cmd.Run(); err != nil {
+                       return fmt.Errorf("While refreshing: %s %v", `repo-` + 
sId, err)
+               }
+       }
 
        args := []string{`--non-interactive`, `-c`, 
filepath.Join(cp.b.Rootfs(), zypperConf), `--root`, cp.b.Rootfs(), 
`--releasever=` + osversion, `-n`, `install`, `--auto-agree-with-licenses`, 
`--download-in-advance`}
        args = append(args, strings.Fields(include)...)
++++++ README.SUSE ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:25.995663693 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:25.995663693 +0200
@@ -14,7 +14,7 @@
 To create openSUSE/SLE singularity images from scratch a number
 of bootdef variables need to be specified:
 
-1. Create a bootdef file 'Singularity', add
+1. Create a bootdef file (for instance 'sle.def'), add
    BootStrap: zypper
 2. Set the OS version:
    OSVersion: 15.0
@@ -26,11 +26,11 @@
 3. For openSUSE the following additional variables need to be
    specified:
    * MirrorURL: URL to the installation repository.
-                Check 'man 8 zypper' fir supported formats
+                Check 'man 8 zypper' for supported formats
    * UpdateURL: (optional) URI of the update repository
 4. For SLE, all required settings are obtained from SCC.
    The following variables are recognized:
-   * SLEProduct: The product code: The following forms may be
+   * Product: The product code: The following forms may be
                  used:
                  <product_id>
                  <product_id>/<os_version>
@@ -43,23 +43,25 @@
                                recognized and replaced by OSVersion.
                  <arch>      : The architecture to use. Defaults
                                to 'uname -m'.
-   * SLEUser: The email a subscription is registed with SCC.
-   * SLERegcode: The SCC registration code provided with the subscription.
-   * SLEgpg:  The GPG key used to sign the repositories. Each line must
+   * User: The email a subscription is registed with SCC.
+   * Regcode: The SCC registration code provided with the subscription.
+   * ProductPGP:  The PGP key used to sign the repositories. Each line must
               be terminated with \n. Long lines may be broken using the
               continuation character '\'. See below.
+              Note: this is not required when an installer repository is
+              provided with MirrorURL.
    Beginning with version 15, the URI to the installer image needs to be
    provided as well:
-   * SLEInstallerURL: See MirrorURL above.
+   * MirrorURL: Repository containing the SLE Installer (see also above).
    Since SLE-15 consists of modules, a list of modules to be used should
    to be specified as well:
-   * SLEModules: Specify the modules in a comma separated list without
+   * Modules: Specify the modules in a comma separated list without
                  spaces. Example:
                  SLEModules: 
sle-module-basesystem,sle-module-server-applications,sle-module-web-scripting,sle-module-hpc
 
-SLEgpg
+ProductPGP
 ======
-SLEgpg: -----BEGIN PGP PUBLIC KEY BLOCK-----\n\
+SLEpgp: -----BEGIN PGP PUBLIC KEY BLOCK-----\n\
 Version: rpm-4.11.2 (NSS-3)\n\
 \n\
 mQENBFEKlmsBCADbpZZbbSC5Zi+HxCR/ynYsVxU5JNNiSSZabN5GMgc9Z0hxeXxp\n\

++++++ Support-multi-line-bootdef-settings.patch ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:26.003663691 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:26.003663691 +0200
@@ -1,8 +1,8 @@
 From: Egbert Eich <e...@suse.com>
-Date: Fri Nov 23 18:22:36 2018 +0100
+Date: Mon May 13 20:51:42 2019 +0200
 Subject: Support multi-line bootdef settings
 Patch-mainline: Not yet
-Git-commit: 0891e1c634b6eeb84f2bacc6fe80339965c6be8a
+Git-commit: d1b5a61230552bddce91e72c4061b5ab429f7d91
 References: 
 
 If lines are separated by a '\' in a bootdef setting definition
@@ -10,67 +10,56 @@
 '\n', replace by a newline.
 
 Signed-off-by: Egbert Eich <e...@suse.com>
-Signed-off-by: Egbert Eich <e...@suse.de>
 ---
- singularity-2.6.0/src/builddef.c | 38 +++++++++++++++++++++++++++++++-------
- 1 file changed, 31 insertions(+), 7 deletions(-)
-diff --git a/singularity-2.6.0/src/builddef.c 
b/singularity-2.6.0/src/builddef.c
-index 3bbb044..d79e606 100644
---- a/src/builddef.c
-+++ b/src/builddef.c
-@@ -112,17 +112,39 @@ int main(int argc, char **argv) {
-         if ( line[0] == '%' ) { // We hit a section, stop parsing for keyword 
tags
-             break;
-         } else if ( ( bootdef_key = strtok(line, ":") ) != NULL ) {
-+            char *tmp, *bootdef_value = NULL;
+ .../singularity/pkg/build/types/parser/deffile.go  | 28 ++++++++++++++++++----
+ 1 file changed, 23 insertions(+), 5 deletions(-)
+diff --git 
a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go 
b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
+index b79c7a1..b490831 100644
+--- a/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
++++ b/src/github.com/sylabs/singularity/pkg/build/types/parser/deffile.go
+@@ -334,22 +334,40 @@ func doHeader(h string, d *types.Definition) (err error) 
{
+       h = strings.TrimSpace(h)
+       toks := strings.Split(h, "\n")
+       header := make(map[string]string)
++      cont_key, cont_val := "", ""
  
-             chomp(bootdef_key);
-+          bootdef_key = strdup(bootdef_key);
- 
--            char *bootdef_value;
--
--            bootdef_value = strtok(NULL, "\n");
--            char empty[] = "";
--            if (bootdef_value == NULL) {
--                bootdef_value = empty;
-+            tmp = strtok(NULL, "\n");
-+            if (tmp == NULL) {
-+                bootdef_value = strdup("");
-             } else {
--                chomp(bootdef_value);
-+              int follow_line;
-+              do {
-+                  int len = strlen(tmp) - 1;
-+                  if (len >= 0 && tmp[len] == '\\') {
-+                      follow_line = 1;
-+                      tmp[len] = '\0';
-+                      if (len > 1 && tmp[len - 2] == '\\' && tmp[len - 1] == 
'n') {
-+                          tmp[len - 2] = '\n';
-+                          tmp[len - 1] = '\0';
+       for _, line := range toks {
+               // skip empty or comment lines
+               if line = strings.TrimSpace(line); line == "" || 
strings.Index(line, "#") == 0 {
++                      if len(cont_key) > 0 {
++                              d.Header[cont_key] = cont_val
++                              cont_key, cont_val = "", "";
 +                      }
-+                  } else {
-+                      follow_line = 0;
-+                  }
-+                  len = (bootdef_value != NULL) ? strlen(bootdef_value) : 0;
-+                  bootdef_value = (char *)realloc(bootdef_value, len + 
strlen(tmp) + 1);
-+                  if (len == 0) bootdef_value[0] = '\0';
-+                  strcat(bootdef_value, tmp);
-+                  if (follow_line == 0 ||
-+                      fgets(line, MAX_LINE_LEN, bootdef_fp) == NULL ||
-+                      (tmp = strtok(line, "\n")) == NULL ) {
-+                      break;
-+                  }
-+              } while (1);
-+              chomp(bootdef_value);
-             }
+                       continue
+               }
  
-             singularity_message(VERBOSE2, "Got bootstrap definition key/val 
'%s' = '%s'\n", bootdef_key, bootdef_value);
-@@ -145,6 +167,8 @@ int main(int argc, char **argv) {
-             // to environment
-             envar_set(uppercase(bootdef_key), bootdef_value, 1);
-             envar_set(strjoin("SINGULARITY_DEFFILE_", 
uppercase(bootdef_key)), bootdef_value, 1);
-+          free(bootdef_key);
-+          free(bootdef_value);
-         }
-     }
+               // trim any comments on header lines
+               trimLine := strings.Split(line, "#")[0]
++              if len(cont_val) == 0 {
++                      linetoks := strings.SplitN(trimLine, ":", 2)
++                      if len(linetoks) == 1 {
++                              return fmt.Errorf("header key %s had no val", 
linetoks[0])
++                      }
  
+-              linetoks := strings.SplitN(trimLine, ":", 2)
+-              if len(linetoks) == 1 {
+-                      return fmt.Errorf("header key %s had no val", 
linetoks[0])
++                      key, val := 
strings.ToLower(strings.TrimSpace(linetoks[0])), strings.TrimSpace(linetoks[1])
++              } else {
++                      key, val := cont_key, cont_val + 
strings.TrimSpace(trimLine)
++                      cont_key, cont_val = "", ""
++              }
++              // continuation
++              if strings.HasSuffix(val, "\\") {
++                      cont_key = key
++                      cont_val = strings.TrimSuffix(val, "\\")
++                      if strings.HasSuffix(cont_val, "\\n") {
++                              cont_val = strings.TrimSuffix(cont_val, "\\n") 
+ "\n";
++                      }
++                      continue
+               }
+-
+-              key, val := strings.ToLower(strings.TrimSpace(linetoks[0])), 
strings.TrimSpace(linetoks[1])
+               if _, ok := validHeaders[key]; !ok {
+                       return fmt.Errorf("invalid header keyword found: %s", 
key)
+               }

++++++ build-position-independent-binaries.patch ++++++
From: Egbert Eich <e...@suse.com>
Date: Fri May 17 11:15:57 2019 +0200
Subject: build position independent binaries
Patch-mainline: Not yet
Git-commit: a083559a1c42459142e3501a33581089cb35e6d2
References: 

Signed-off-by: Egbert Eich <e...@suse.com>
---
 src/github.com/sylabs/singularity/mlocal/frags/go_common_opts.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/github.com/sylabs/singularity/mlocal/frags/go_common_opts.mk 
b/src/github.com/sylabs/singularity/mlocal/frags/go_common_opts.mk
index 87359af..045563a 100644
--- a/src/github.com/sylabs/singularity/mlocal/frags/go_common_opts.mk
+++ b/src/github.com/sylabs/singularity/mlocal/frags/go_common_opts.mk
@@ -2,10 +2,10 @@
 GO111MODULE := on
 GO_TAGS := containers_image_openpgp sylog
 GO_LDFLAGS :=
-GO_BUILDMODE := -buildmode=default
+GO_BUILDMODE := -buildmode=pie
 GO_GCFLAGS := -gcflags=all=-trimpath=$(SOURCEDIR)
 GO_ASMFLAGS := -asmflags=all=-trimpath=$(SOURCEDIR)
-GO_MODFLAGS :=
+GO_MODFLAGS := -x -v -work
 GOFLAGS := -mod=vendor
 
 export GOFLAGS GO111MODULE
++++++ singularity-2.6.1.tar.gz -> singularity-3.2.1.tar.gz ++++++
++++ 590071 lines of diff (skipped)

++++++ singularity-rpmlintrc ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:26.623663528 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:26.623663528 +0200
@@ -1,5 +1,2 @@
-# This will be removed as soon as the update to
-# devel:openSUSE:Factory:rpmlint/rpmlint is in 
-# Factory
-addFilter(".*non-standard-gid.*")
-addFilter(".*missing-call-to-chdir-with-chroot.*")
+#  Have the same binary with and without setuid bit
+addFilter("files-duplicated-waste")

++++++ zypper-install-Fix-dbpath-for-newer-versions-of-SUSE-Linux.patch ++++++
--- /var/tmp/diff_new_pack.M1biMj/_old  2019-07-22 12:20:26.631663526 +0200
+++ /var/tmp/diff_new_pack.M1biMj/_new  2019-07-22 12:20:26.631663526 +0200
@@ -1,25 +1,24 @@
 From: Egbert Eich <e...@suse.com>
-Date: Mon Nov 19 14:35:23 2018 +0100
+Date: Mon May 13 14:29:25 2019 +0200
 Subject: zypper install: Fix dbpath for newer versions of SUSE Linux
 Patch-mainline: Not yet
-Git-commit: 4c921f9889d1d072e8aecdeeb3bffe1557c0c619
+Git-commit: 268150a7519d4e3fe0884fd2760fecfe5996f8a8
 References: 
 
 Signed-off-by: Egbert Eich <e...@suse.com>
 ---
- singularity-2.6.0/libexec/bootstrap-scripts/deffile-driver-zypper.sh | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-diff --git 
a/singularity-2.6.0/libexec/bootstrap-scripts/deffile-driver-zypper.sh 
b/singularity-2.6.0/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-index 5e0470c..1f8252d 100644
---- a/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-+++ b/libexec/bootstrap-scripts/deffile-driver-zypper.sh
-@@ -66,7 +66,8 @@ if [ -z "${RPM_CMD:-}" ]; then
-     ABORT 1
- fi
- RPM_DBPATH=$(rpm --showrc | grep -E ":\s_dbpath\s" | cut -f2)
--if [ "$RPM_DBPATH" != '%{_var}/lib/rpm' ]; then
-+if [ "$RPM_DBPATH" != '%{_var}/lib/rpm' \
-+    -a "$RPM_DBPATH" != '%{_usr}/lib/sysimage/rpm' ]; then
-     message ERROR "RPM database is using a weird path: %s\n" "$RPM_DBPATH"
-     message WARNING "You are probably running this bootstrap on Debian or 
Ubuntu.\n"
-     message WARNING "There is a way to work around this problem:\n"
+ .../singularity/internal/pkg/build/sources/conveyorPacker_zypper.go     | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+diff --git 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+index d441096..0e6f00a 100644
+--- 
a/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
++++ 
b/src/github.com/sylabs/singularity/internal/pkg/build/sources/conveyorPacker_zypper.go
+@@ -230,7 +230,7 @@ func rpmPathCheck() (err error) {
+               }
+       }
+ 
+-      if rpmDBPath != `%{_var}/lib/rpm` {
++      if rpmDBPath != `%{_var}/lib/rpm` && rpmDBPath != 
`%{_usr}/lib/sysimage/rpm` {
+               return fmt.Errorf("RPM database is using a non-standard path: 
%s\n"+
+                       "There is a way to work around this problem:\n"+
+                       "Create a file at path %s/.rpmmacros.\n"+


Reply via email to