Hello community,

here is the log from the commit of package python-kiwi for openSUSE:Factory 
checked in at 2018-05-13 15:54:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-kiwi (Old)
 and      /work/SRC/openSUSE:Factory/.python-kiwi.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-kiwi"

Sun May 13 15:54:44 2018 rev:27 rq:605755 version:9.15.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-kiwi/python-kiwi.changes  2018-05-08 
13:32:21.644334175 +0200
+++ /work/SRC/openSUSE:Factory/.python-kiwi.new/python-kiwi.changes     
2018-05-13 15:54:47.160835021 +0200
@@ -1,0 +2,60 @@
+Wed May  9 14:53:02 CEST 2018 - m...@suse.de
+
+- Bump version: 9.15.0 → 9.15.1
+  
+-------------------------------------------------------------------
+Wed May  9 12:52:59 CEST 2018 - davidcass...@gmail.com
+  
+- Add a chapter for uninstall package requests in docs (#726)
+  
+  Add a chapter for uninstall package requests in docs
+  
+-------------------------------------------------------------------
+Tue May  8 16:31:57 CEST 2018 - m...@suse.de
+  
+- Update arm integration test
+  
+  Existing panda build was outdated and non functional.
+  Move the test to a more popular target and write the
+  image description to use technology matching the
+  suse arm development effort. Target is now Rpi(64bit)
+  
+-------------------------------------------------------------------
+Tue May  8 11:18:21 CEST 2018 - m...@suse.de
+  
+- Use latest version of sphinx
+  
+  Formerly sphinx==1.6.7 was used because travis-sphinx failed
+  with latest sphinx. Now travis-sphinx fails with 1.6.7 and
+  I hope using latest sphinx will fix that
+  
+-------------------------------------------------------------------
+Tue May  8 08:42:24 CEST 2018 - m...@suse.de
+  
+- Bump version: 9.14.7 → 9.15.0
+  
+-------------------------------------------------------------------
+Mon May  7 15:49:51 CEST 2018 - dcass...@suse.com
+  
+- Add comment in pinch_system calls
+  
+-------------------------------------------------------------------
+Mon May  7 15:10:47 CEST 2018 - dcass...@suse.com
+  
+- Refining the uninstall type implementation
+  
+-------------------------------------------------------------------
+Fri May  4 15:00:31 CEST 2018 - dcass...@suse.com
+  
+- Add uninstall pacakges type
+  
+  This commit adds a new `uninstall` type for packages. Packages listed
+  with this type will be removed by the package manager cleaning also any
+  unneeded dependency. The removal is executed after running `config.sh`.
+  
+  Also in this commit `delete` type for packages is now executed after
+  `uninstall` packages, meaing it also happens after `config.sh`.
+  
+  Fixes #625
+  
+-------------------------------------------------------------------
@@ -4,0 +65,5 @@
+  
+-------------------------------------------------------------------
+Fri May  4 10:40:13 CEST 2018 - dcass...@suse.com
+  
+- Some simple code cleaning

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

Other differences:
------------------
++++++ python-kiwi.spec ++++++
--- /var/tmp/diff_new_pack.yz75iK/_old  2018-05-13 15:54:47.892808309 +0200
+++ /var/tmp/diff_new_pack.yz75iK/_new  2018-05-13 15:54:47.892808309 +0200
@@ -38,7 +38,7 @@
 %endif
 
 Name:           python-kiwi
-Version:        9.14.7
+Version:        9.15.1
 Provides:       kiwi-schema = 6.6
 Release:        0
 Url:            https://github.com/SUSE/kiwi

++++++ python-kiwi.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/.bumpversion.cfg 
new/kiwi-9.15.1/.bumpversion.cfg
--- old/kiwi-9.14.7/.bumpversion.cfg    2018-05-04 10:52:28.000000000 +0200
+++ new/kiwi-9.15.1/.bumpversion.cfg    2018-05-09 14:53:02.000000000 +0200
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 9.14.7
+current_version = 9.15.1
 commit = True
 tag = True
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/.virtualenv.dev-requirements.txt 
new/kiwi-9.15.1/.virtualenv.dev-requirements.txt
--- old/kiwi-9.14.7/.virtualenv.dev-requirements.txt    2018-02-12 
15:56:49.000000000 +0100
+++ new/kiwi-9.15.1/.virtualenv.dev-requirements.txt    2018-05-08 
11:17:03.000000000 +0200
@@ -37,11 +37,7 @@
 generateDS
 
 # for building documentation
-
-# sphinx 1.7.0 is not compatible with travis-sphinx
-# thus we stick with 1.6.7 until travis-sphinx followed
-# the sphinx changes
-sphinx==1.6.7
+sphinx
 
 sphinx_rtd_theme
 sphinxcontrib-spelling
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/PKG-INFO new/kiwi-9.15.1/PKG-INFO
--- old/kiwi-9.14.7/PKG-INFO    2018-05-04 10:58:11.000000000 +0200
+++ new/kiwi-9.15.1/PKG-INFO    2018-05-09 14:58:53.000000000 +0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: kiwi
-Version: 9.14.7
+Version: 9.15.1
 Summary: KIWI - Appliance Builder (next generation)
 Home-page: http://suse.github.io/kiwi
 Author: Marcus Schaefer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi.8 
new/kiwi-9.15.1/doc/build/man/kiwi.8
--- old/kiwi-9.14.7/doc/build/man/kiwi.8        2018-05-04 10:58:00.000000000 
+0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi.8        2018-05-09 14:58:43.000000000 
+0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi \- Creating Operating System Images
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::image::info.8 
new/kiwi-9.15.1/doc/build/man/kiwi::image::info.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::image::info.8   2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::image::info.8   2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::IMAGE::INFO" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::IMAGE::INFO" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::image::info \- Provide detailed information about an image description
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::image::resize.8 
new/kiwi-9.15.1/doc/build/man/kiwi::image::resize.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::image::resize.8 2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::image::resize.8 2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::IMAGE::RESIZE" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::IMAGE::RESIZE" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::image::resize \- Resize disk images to new geometry
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::result::bundle.8 
new/kiwi-9.15.1/doc/build/man/kiwi::result::bundle.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::result::bundle.8        2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::result::bundle.8        2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::RESULT::BUNDLE" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::RESULT::BUNDLE" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::result::bundle \- Bundle build results
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::result::list.8 
new/kiwi-9.15.1/doc/build/man/kiwi::result::list.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::result::list.8  2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::result::list.8  2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::RESULT::LIST" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::RESULT::LIST" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::result::list \- List build results
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::system::build.8 
new/kiwi-9.15.1/doc/build/man/kiwi::system::build.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::system::build.8 2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::system::build.8 2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::SYSTEM::BUILD" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::SYSTEM::BUILD" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::system::build \- Build image in combined prepare and create step
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::system::create.8 
new/kiwi-9.15.1/doc/build/man/kiwi::system::create.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::system::create.8        2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::system::create.8        2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::SYSTEM::CREATE" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::SYSTEM::CREATE" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::system::create \- Create image from prepared root system
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::system::prepare.8 
new/kiwi-9.15.1/doc/build/man/kiwi::system::prepare.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::system::prepare.8       2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::system::prepare.8       2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::SYSTEM::PREPARE" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::SYSTEM::PREPARE" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::system::prepare \- Prepare image root system
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/build/man/kiwi::system::update.8 
new/kiwi-9.15.1/doc/build/man/kiwi::system::update.8
--- old/kiwi-9.14.7/doc/build/man/kiwi::system::update.8        2018-05-04 
10:58:00.000000000 +0200
+++ new/kiwi-9.15.1/doc/build/man/kiwi::system::update.8        2018-05-09 
14:58:43.000000000 +0200
@@ -1,6 +1,6 @@
 .\" Man page generated from reStructuredText.
 .
-.TH "KIWI::SYSTEM::UPDATE" "8" "May 04, 2018" "9.14.7" "kiwi"
+.TH "KIWI::SYSTEM::UPDATE" "8" "May 09, 2018" "9.15.1" "kiwi"
 .SH NAME
 kiwi::system::update \- Update/Upgrade image root system
 .
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kiwi-9.14.7/doc/source/building/working_with_images/uninstall_package_requests.rst
 
new/kiwi-9.15.1/doc/source/building/working_with_images/uninstall_package_requests.rst
--- 
old/kiwi-9.14.7/doc/source/building/working_with_images/uninstall_package_requests.rst
      1970-01-01 01:00:00.000000000 +0100
+++ 
new/kiwi-9.15.1/doc/source/building/working_with_images/uninstall_package_requests.rst
      2018-05-09 14:52:53.000000000 +0200
@@ -0,0 +1,88 @@
+.. _gracefully_uninstall:
+
+Gracefully Uninstall System Packages
+====================================
+
+.. sidebar:: Abstract
+
+   This page provides some details about uninstalling
+   packages and how it could be used in order to remove
+   packages once the image configuration, using the `config.sh`
+   script, is done.
+
+Uninstalling packages from the system image that were previously installed
+during the installation phase is an operation that can be
+handy under certain circumstances. As an example, someone could be interested
+in performing some configuration tasks in the
+`config.sh` script (see :ref:`prepare step <prepare-step>` for
+further details). That would require to include some extra packages,
+which are only needed at build time. One example would be compiling
+some unpacked application sources.
+
+KIWI description file schema defines package requests of type `uninstall`
+and type `delete`:
+
+  * The `uninstall` requests perform a clean packages removal by removing
+    any package dependent on the requested ones and also removing orphan
+    dependencies.
+
+  * The `delete` requests perform a hard removal without any dependency
+    check, thus only listed packages are deleted even if it breaks
+    dependencies or compromises any underlying package database.
+
+This page focuses on `uninstall` package requests.
+
+This is an example of the package requests in a description of a Container
+image that removes user related tools and development tools:
+
+.. code:: xml
+
+      <packages type="image">
+        <package name="ca-certificates"/>
+        <package name="ca-certificates-mozilla"/>
+        <package name="coreutils"/>
+        <package name="iputils"/>
+        <package name="openSUSE-build-key"/>
+        <package name="krb5"/>
+        <package name="netcfg"/>
+        <package name="kubic-locale-archive"/>
+        <package name="make"/>
+        <package name="llvm-clang"/>
+        <archive name="foo_app_sources.tar.gz"/>
+      </packages>
+      <!-- These packages will be uninstalled after running config.sh -->
+      <packages type="uninstall">
+        <package name="shadow"/>
+        <package name="make"/>
+        <package name="llvm-clang"/>
+      </packages>
+    
+
+In the previous example after installing all the packages and archives, image
+repositories are configured and then the `config.sh` script is executed.
+In `config.sh` the `foo_app_sources.tar.gz` could be compiled using the
+`make` and `llvm` packages with something like a `make install` call. It is
+a common practice to build tiny and single purpose container images, thus
+makes sense to remove unneeded packages, like `make` and `llvm-clang`.
+To gracefully remove them, they have been included into the
+*type="uninstall"* packages list. Those packages will be removed including
+a dependency cleanup.
+
+.. warning::
+
+   An `uninstall` packages request deletes:
+
+     * the listed packages,
+     * the packages dependent on the listed ones, and
+     * any orphaned dependecy of the listed packages.
+
+   Use this feature with caution as it can easily
+   cause the removal of sensitive tools leading to failures in
+   later build stages.
+
+In the above example also the *shadow* package is being removed, again, in
+this specific case, it is not expected to be needed in the final image.
+The *shadow* package mainly provides tools to handle user accounts.
+In a container image, once everything is installed and configured, it is
+not expected to require any further user account modification to the image, 
+tools such as *useradd* or *usermod* will not be required.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kiwi-9.14.7/doc/source/building/working_with_images.rst 
new/kiwi-9.15.1/doc/source/building/working_with_images.rst
--- old/kiwi-9.14.7/doc/source/building/working_with_images.rst 2018-02-26 
16:34:13.000000000 +0100
+++ new/kiwi-9.15.1/doc/source/building/working_with_images.rst 2018-05-09 
14:52:53.000000000 +0200
@@ -8,10 +8,11 @@
    :maxdepth: 1
 
    working_with_images/iso_to_usb_stick_deployment
-   working_with_images/iso_to_usb_stick_file_based_deployment.rst
+   working_with_images/iso_to_usb_stick_file_based_deployment
    working_with_images/vmx_setup_for_ec2
    working_with_images/vmx_setup_for_azure
    working_with_images/vmx_setup_for_google
    working_with_images/setup_pxe_bootserver
    working_with_images/setup_yast_on_first_boot
    working_with_images/pxe_client_configuration
+   working_with_images/uninstall_package_requests 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/doc/source/conf.py 
new/kiwi-9.15.1/doc/source/conf.py
--- old/kiwi-9.14.7/doc/source/conf.py  2018-05-04 10:52:28.000000000 +0200
+++ new/kiwi-9.15.1/doc/source/conf.py  2018-05-09 14:53:02.000000000 +0200
@@ -90,7 +90,7 @@
 # built documents.
 #
 # The short X.Y version.
-version = u'9.14.7'
+version = u'9.15.1'
 # The full version, including alpha/beta/rc tags.
 release = version
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/exceptions.py 
new/kiwi-9.15.1/kiwi/exceptions.py
--- old/kiwi-9.14.7/kiwi/exceptions.py  2018-04-20 15:57:24.000000000 +0200
+++ new/kiwi-9.15.1/kiwi/exceptions.py  2018-05-08 08:41:59.000000000 +0200
@@ -360,6 +360,13 @@
     """
 
 
+class KiwiPackagesDeletePhaseFailed(KiwiError):
+    """
+    Exception raised if the packages deletion phase in system prepare
+    fails.
+    """
+
+
 class KiwiIsoLoaderError(KiwiError):
     """
     Exception raised if no isolinux loader file could be found.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/schema/kiwi.rnc 
new/kiwi-9.15.1/kiwi/schema/kiwi.rnc
--- old/kiwi-9.14.7/kiwi/schema/kiwi.rnc        2018-04-24 09:59:15.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi/schema/kiwi.rnc        2018-05-08 08:41:59.000000000 
+0200
@@ -2537,7 +2537,8 @@
         ## packages are only installed if this build type is requested.
         attribute type {
             "bootstrap" | "delete" | "docker" | "image" |
-            "iso" | "oem" | "pxe" | "vmx" | "oci"
+            "iso" | "oem" | "pxe" | "vmx" | "oci" |
+            "uninstall"
         }
     k.packages.profiles.attribute = k.profiles.attribute
     k.packages.patternType.attribute =
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/schema/kiwi.rng 
new/kiwi-9.15.1/kiwi/schema/kiwi.rng
--- old/kiwi-9.14.7/kiwi/schema/kiwi.rng        2018-04-24 09:59:15.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi/schema/kiwi.rng        2018-05-08 08:41:59.000000000 
+0200
@@ -3981,6 +3981,7 @@
           <value>pxe</value>
           <value>vmx</value>
           <value>oci</value>
+          <value>uninstall</value>
         </choice>
       </attribute>
     </define>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/system/prepare.py 
new/kiwi-9.15.1/kiwi/system/prepare.py
--- old/kiwi-9.14.7/kiwi/system/prepare.py      2018-04-20 15:57:24.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi/system/prepare.py      2018-05-08 08:41:59.000000000 
+0200
@@ -34,7 +34,8 @@
     KiwiSystemUpdateFailed,
     KiwiSystemInstallPackagesFailed,
     KiwiSystemDeletePackagesFailed,
-    KiwiInstallPhaseFailed
+    KiwiInstallPhaseFailed,
+    KiwiPackagesDeletePhaseFailed
 )
 
 
@@ -273,25 +274,39 @@
                     'System archive installation failed: %s' % format(e)
                 )
 
-    def pinch_system(self, manager, force=False):
+    def pinch_system(self, manager=None, force=False):
         """
-        Delete packages marked for deletion in the XML description
+        Delete packages marked for deletion in the XML description. If force
+        param is set to False uninstalls packages marked with
+        `type="uninstall"` if any; if force is set to True deletes packages
+        marked with `type="delete"` if any.
 
-        :param object manager: instance of a :class:`PackageManager` subclass
-        :param bool force: force deletion true|false
+        :param object manager: instance of :class:`PackageManager`
+        :param bool force: Forced deletion True|False
 
-        :raises KiwiInstallPhaseFailed: if the deletion packages process fails
+        :raises KiwiPackagesDeletePhaseFailed: if the deletion packages
+            process fails
         """
         to_become_deleted_packages = \
-            self.xml_state.get_to_become_deleted_packages()
-        if to_become_deleted_packages:
-            log.info('Pinch system')
-            try:
-                self.delete_packages(manager, to_become_deleted_packages, 
force)
-            except Exception as e:
-                raise KiwiInstallPhaseFailed(
-                    '%s: %s' % (type(e).__name__, format(e))
+            self.xml_state.get_to_become_deleted_packages(force)
+        try:
+            if to_become_deleted_packages:
+                log.info('{0} system packages (chroot)'.format(
+                    'Force deleting' if force else 'Uninstalling')
                 )
+                if manager is None:
+                    package_manager = self.xml_state.get_package_manager()
+                    manager = PackageManager(
+                        Repository(self.root_bind, package_manager),
+                        package_manager
+                    )
+                self.delete_packages(
+                    manager, to_become_deleted_packages, force
+                )
+        except Exception as e:
+            raise KiwiPackagesDeletePhaseFailed(
+                '%s: %s' % (type(e).__name__, format(e))
+            )
 
     def install_packages(self, manager, packages):
         """
@@ -326,7 +341,9 @@
     def delete_packages(self, manager, packages, force=False):
         """
         Delete one or more packages using the package manager inside
-        of the new root directory
+        of the new root directory. If the removal is set with `force` flag
+        only listed packages are deleted and any dependency break or leftover
+        is ignored.
 
         :param object manager: instance of a :class:`PackageManager` subclass
         :param list packages: package list
@@ -334,7 +351,9 @@
 
         :raises KiwiSystemDeletePackagesFailed: if installation process fails
         """
-        log.info('Deleting system packages (chroot)')
+        log.info('{0} system packages (chroot)'.format(
+            'Force deleting' if force else 'Uninstall'
+        ))
         all_delete_items = self._setup_requests(
             manager, packages
         )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/tasks/system_build.py 
new/kiwi-9.15.1/kiwi/tasks/system_build.py
--- old/kiwi-9.14.7/kiwi/tasks/system_build.py  2018-04-18 10:31:36.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi/tasks/system_build.py  2018-05-08 08:41:59.000000000 
+0200
@@ -173,12 +173,6 @@
         self.runtime_checker.check_repositories_configured()
         self.runtime_checker.check_image_include_repos_publicly_resolvable()
 
-        package_requests = False
-        if self.command_args['--add-package']:
-            package_requests = True
-        if self.command_args['--delete-package']:
-            package_requests = True
-
         log.info('Preparing new root system')
         system = SystemPrepare(
             self.xml_state,
@@ -193,15 +187,14 @@
         system.install_system(
             manager
         )
-        if package_requests:
-            if self.command_args['--add-package']:
-                system.install_packages(
-                    manager, self.command_args['--add-package']
-                )
-            if self.command_args['--delete-package']:
-                system.delete_packages(
-                    manager, self.command_args['--delete-package']
-                )
+        if self.command_args['--add-package']:
+            system.install_packages(
+                manager, self.command_args['--add-package']
+            )
+        if self.command_args['--delete-package']:
+            system.delete_packages(
+                manager, self.command_args['--delete-package']
+            )
 
         profile = Profile(self.xml_state)
 
@@ -223,9 +216,6 @@
         setup.setup_plymouth_splash()
         setup.setup_timezone()
 
-        system.pinch_system(
-            manager=manager, force=True
-        )
         # make sure manager instance is cleaned up now
         del manager
 
@@ -233,6 +223,14 @@
         setup.import_repositories_marked_as_imageinclude()
         setup.call_config_script()
 
+        # handle uninstall package requests, gracefully uninstall
+        # with dependency cleanup
+        system.pinch_system(force=False)
+
+        # handle delete package requests, forced uninstall without
+        # any dependency resolution
+        system.pinch_system(force=True)
+
         # make sure system instance is cleaned up now
         del system
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/tasks/system_prepare.py 
new/kiwi-9.15.1/kiwi/tasks/system_prepare.py
--- old/kiwi-9.14.7/kiwi/tasks/system_prepare.py        2018-04-18 
10:31:36.000000000 +0200
+++ new/kiwi-9.15.1/kiwi/tasks/system_prepare.py        2018-05-08 
08:41:59.000000000 +0200
@@ -160,12 +160,6 @@
         self.runtime_checker.check_repositories_configured()
         self.runtime_checker.check_image_include_repos_publicly_resolvable()
 
-        package_requests = False
-        if self.command_args['--add-package']:
-            package_requests = True
-        if self.command_args['--delete-package']:
-            package_requests = True
-
         log.info('Preparing system')
         system = SystemPrepare(
             self.xml_state,
@@ -180,15 +174,15 @@
         system.install_system(
             manager
         )
-        if package_requests:
-            if self.command_args['--add-package']:
-                system.install_packages(
-                    manager, self.command_args['--add-package']
-                )
-            if self.command_args['--delete-package']:
-                system.delete_packages(
-                    manager, self.command_args['--delete-package']
-                )
+
+        if self.command_args['--add-package']:
+            system.install_packages(
+                manager, self.command_args['--add-package']
+            )
+        if self.command_args['--delete-package']:
+            system.delete_packages(
+                manager, self.command_args['--delete-package']
+            )
 
         profile = Profile(self.xml_state)
 
@@ -210,10 +204,6 @@
         setup.setup_plymouth_splash()
         setup.setup_timezone()
 
-        system.pinch_system(
-            manager=manager, force=True
-        )
-
         # make sure manager instance is cleaned up now
         del manager
 
@@ -221,6 +211,14 @@
         setup.import_repositories_marked_as_imageinclude()
         setup.call_config_script()
 
+        # handle uninstall package requests, gracefully uninstall
+        # with dependency cleanup
+        system.pinch_system(force=False)
+
+        # handle delete package requests, forced uninstall without
+        # any dependency resolution
+        system.pinch_system(force=True)
+
         # make sure system instance is cleaned up now
         del system
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/version.py 
new/kiwi-9.15.1/kiwi/version.py
--- old/kiwi-9.14.7/kiwi/version.py     2018-05-04 10:52:28.000000000 +0200
+++ new/kiwi-9.15.1/kiwi/version.py     2018-05-09 14:53:02.000000000 +0200
@@ -18,5 +18,5 @@
 """
 Global version information used in kiwi and the package
 """
-__version__ = '9.14.7'
-__githash__ = '348c0193245fd637c3ab841ef1ec34bd6ae5b56c'
+__version__ = '9.15.1'
+__githash__ = '2a6ef0fe5217b3fa52c5c8212c080e9d2aebad4b'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi/xml_state.py 
new/kiwi-9.15.1/kiwi/xml_state.py
--- old/kiwi-9.14.7/kiwi/xml_state.py   2018-04-24 09:59:15.000000000 +0200
+++ new/kiwi-9.15.1/kiwi/xml_state.py   2018-05-08 08:41:59.000000000 +0200
@@ -257,9 +257,13 @@
                             )
         return result
 
-    def get_to_become_deleted_packages(self):
+    def get_to_become_deleted_packages(self, force=True):
         """
-        List of package names from the type="delete" packages section(s)
+        List of package names from the type="delete" or type="uninstall"
+        packages section(s)
+
+        :param bool force: return "delete" type if True, "uninstall" type
+            otherwise
 
         :return: package names
 
@@ -267,7 +271,7 @@
         """
         result = []
         to_become_deleted_packages_sections = self.get_packages_sections(
-            ['delete']
+            ['delete' if force else 'uninstall']
         )
         package_list = self.get_package_sections(
             to_become_deleted_packages_sections
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi.egg-info/PKG-INFO 
new/kiwi-9.15.1/kiwi.egg-info/PKG-INFO
--- old/kiwi-9.14.7/kiwi.egg-info/PKG-INFO      2018-05-04 10:58:10.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi.egg-info/PKG-INFO      2018-05-09 14:58:53.000000000 
+0200
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: kiwi
-Version: 9.14.7
+Version: 9.15.1
 Summary: KIWI - Appliance Builder (next generation)
 Home-page: http://suse.github.io/kiwi
 Author: Marcus Schaefer
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/kiwi.egg-info/SOURCES.txt 
new/kiwi-9.15.1/kiwi.egg-info/SOURCES.txt
--- old/kiwi-9.14.7/kiwi.egg-info/SOURCES.txt   2018-05-04 10:58:11.000000000 
+0200
+++ new/kiwi-9.15.1/kiwi.egg-info/SOURCES.txt   2018-05-09 14:58:53.000000000 
+0200
@@ -42,6 +42,7 @@
 doc/source/building/working_with_images/pxe_client_configuration.rst
 doc/source/building/working_with_images/setup_pxe_bootserver.rst
 doc/source/building/working_with_images/setup_yast_on_first_boot.rst
+doc/source/building/working_with_images/uninstall_package_requests.rst
 doc/source/building/working_with_images/vmx_setup_for_azure.rst
 doc/source/building/working_with_images/vmx_setup_for_ec2.rst
 doc/source/building/working_with_images/vmx_setup_for_google.rst
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/data/description/config.xml 
new/kiwi-9.15.1/test/data/description/config.xml
--- old/kiwi-9.14.7/test/data/description/config.xml    2018-04-24 
09:59:15.000000000 +0200
+++ new/kiwi-9.15.1/test/data/description/config.xml    2018-05-08 
08:42:00.000000000 +0200
@@ -196,4 +196,7 @@
     <packages type="delete">
         <package name="kernel-debug"/>
     </packages>
+    <packages type="uninstall">
+        <package name="shadow"/>
+    </packages>
 </image>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kiwi-9.14.7/test/data/description.buildservice/appliance.kiwi 
new/kiwi-9.15.1/test/data/description.buildservice/appliance.kiwi
--- old/kiwi-9.14.7/test/data/description.buildservice/appliance.kiwi   
2018-04-24 09:59:15.000000000 +0200
+++ new/kiwi-9.15.1/test/data/description.buildservice/appliance.kiwi   
2018-05-08 08:42:00.000000000 +0200
@@ -196,4 +196,7 @@
     <packages type="delete">
         <package name="kernel-debug"/>
     </packages>
+    <packages type="uninstall">
+        <package name="shadow"/>
+    </packages>
 </image>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/data/example_config.xml 
new/kiwi-9.15.1/test/data/example_config.xml
--- old/kiwi-9.14.7/test/data/example_config.xml        2018-04-24 
09:59:15.000000000 +0200
+++ new/kiwi-9.15.1/test/data/example_config.xml        2018-05-08 
08:42:00.000000000 +0200
@@ -196,4 +196,7 @@
     <packages type="delete">
         <package name="kernel-debug"/>
     </packages>
+    <packages type="uninstall">
+        <package name="shadow"/>
+    </packages>
 </image>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/data/root-dir/image/config.xml 
new/kiwi-9.15.1/test/data/root-dir/image/config.xml
--- old/kiwi-9.14.7/test/data/root-dir/image/config.xml 2018-04-24 
09:59:15.000000000 +0200
+++ new/kiwi-9.15.1/test/data/root-dir/image/config.xml 2018-05-08 
08:42:00.000000000 +0200
@@ -196,4 +196,7 @@
     <packages type="delete">
         <package name="kernel-debug"/>
     </packages>
+    <packages type="uninstall">
+        <package name="shadow"/>
+    </packages>
 </image>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/unit/system_prepare_test.py 
new/kiwi-9.15.1/test/unit/system_prepare_test.py
--- old/kiwi-9.14.7/test/unit/system_prepare_test.py    2017-09-15 
10:37:16.000000000 +0200
+++ new/kiwi-9.15.1/test/unit/system_prepare_test.py    2018-05-08 
08:42:00.000000000 +0200
@@ -9,7 +9,8 @@
     KiwiSystemUpdateFailed,
     KiwiSystemInstallPackagesFailed,
     KiwiSystemDeletePackagesFailed,
-    KiwiInstallPhaseFailed
+    KiwiInstallPhaseFailed,
+    KiwiPackagesDeletePhaseFailed
 )
 
 from kiwi.system.prepare import SystemPrepare
@@ -140,12 +141,6 @@
         mock_tar.side_effect = KiwiInstallPhaseFailed
         self.system.install_system(self.manager)
 
-    @raises(KiwiInstallPhaseFailed)
-    @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
-    def test_pinch_system_raises(self, mock_poll):
-        mock_poll.side_effect = Exception
-        self.system.pinch_system(self.manager)
-
     @raises(KiwiSystemDeletePackagesFailed)
     @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
     def test_delete_packages_raises(self, mock_poll):
@@ -332,14 +327,6 @@
         tar.extract.assert_called_once_with('root_dir')
 
     @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
-    def test_pinch_system(self, mock_poll):
-        self.system.pinch_system(self.manager)
-        self.manager.request_package.assert_any_call(
-            'kernel-debug'
-        )
-        self.manager.process_delete_requests.assert_called_once_with(False)
-
-    @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
     def test_install_packages(self, mock_poll):
         self.system.install_packages(self.manager, ['foo'])
         self.manager.request_package.assert_called_once_with('foo')
@@ -349,6 +336,31 @@
         self.system.delete_packages(self.manager, ['foo'])
         self.manager.request_package.assert_called_once_with('foo')
 
+    @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
+    def test_pinch_system(self, mock_poll):
+        self.system.pinch_system(self.manager, force=False)
+        self.system.pinch_system(self.manager, force=True)
+        self.manager.process_delete_requests.assert_has_calls(
+            [call(False), call(True)]
+        )
+
+    @raises(KiwiPackagesDeletePhaseFailed)
+    @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
+    def test_pinch_system_raises(self, mock_poll):
+        mock_poll.side_effect = Exception
+        self.system.pinch_system(self.manager)
+        self.manager.process_delete_requests.assert_called_once_with()
+
+    @patch('kiwi.package_manager.PackageManagerZypper.process_delete_requests')
+    @patch('kiwi.system.prepare.Repository')
+    @patch('kiwi.system.prepare.CommandProcess.poll_show_progress')
+    def test_pinch_system_without_manager(
+        self, mock_poll, mock_repo, mock_requests
+    ):
+        self.system.pinch_system()
+        mock_repo.assert_called_once_with(mock.ANY, 'zypper')
+        mock_requests.assert_called_once_with(False)
+
     @patch('kiwi.system.prepare.CommandProcess.poll')
     def test_update_system(self, mock_poll):
         self.system.update_system(self.manager)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/unit/tasks_system_build_test.py 
new/kiwi-9.15.1/test/unit/tasks_system_build_test.py
--- old/kiwi-9.14.7/test/unit/tasks_system_build_test.py        2018-03-15 
09:58:13.000000000 +0100
+++ new/kiwi-9.15.1/test/unit/tasks_system_build_test.py        2018-05-08 
08:42:00.000000000 +0200
@@ -2,7 +2,7 @@
 import mock
 import os
 
-from mock import patch
+from mock import patch, call
 
 import kiwi
 
@@ -129,8 +129,8 @@
         self.setup.setup_locale.assert_called_once_with()
         self.setup.setup_plymouth_splash.assert_called_once_with()
         self.setup.setup_timezone.assert_called_once_with()
-        self.system_prepare.pinch_system.assert_called_once_with(
-            manager=self.manager, force=True
+        self.system_prepare.pinch_system.assert_has_calls(
+            [call(force=False), call(force=True)]
         )
         self.setup.call_image_script.assert_called_once_with()
         self.builder.create.assert_called_once_with()
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kiwi-9.14.7/test/unit/tasks_system_prepare_test.py 
new/kiwi-9.15.1/test/unit/tasks_system_prepare_test.py
--- old/kiwi-9.14.7/test/unit/tasks_system_prepare_test.py      2018-03-15 
09:58:13.000000000 +0100
+++ new/kiwi-9.15.1/test/unit/tasks_system_prepare_test.py      2018-05-08 
08:42:00.000000000 +0200
@@ -2,7 +2,7 @@
 import mock
 import os
 
-from mock import patch
+from mock import patch, call
 
 import kiwi
 
@@ -122,8 +122,8 @@
         self.setup.setup_plymouth_splash.assert_called_once_with()
         self.setup.setup_timezone.assert_called_once_with()
 
-        self.system_prepare.pinch_system.assert_called_once_with(
-            manager=self.manager, force=True
+        self.system_prepare.pinch_system.assert_has_calls(
+            [call(force=False), call(force=True)]
         )
 
     def test_process_system_prepare_add_package(self):


Reply via email to