commit:     d1dbb555a08951b65c21f900ace740b1a76efa51
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 28 20:58:29 2017 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Dec 29 00:34:30 2017 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d1dbb555

stagebase.py: Fix cleaning portage_prefix errors

Remove outer [ ] pair in the pjoin.
Remove leading / in the "/etc/portage/package.%s"  Ben Kohler <bkohler <AT> 
gmail.com>
Add "accept_keywords" package.* entry to clean. Ben Kohler <bkohler <AT> 
gmail.com>
Add extra logging info.
Change from using chroot_path to destpath in case it is different (stage1).
Use normpath() on some other cleanables to remove "//"'s

 catalyst/base/stagebase.py | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index a6a32f5a..8f9a5dbd 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1207,7 +1207,7 @@ class StageBase(TargetBase, ClearBase, GenBase):
                else:
                        for x in self.settings["cleanables"]:
                                log.notice('Cleaning chroot: %s', x)
-                               clear_path(self.settings["destpath"] + x)
+                               clear_path(normpath(self.settings["destpath"] + 
x))
 
                # Put /etc/hosts back into place
                hosts_file = self.settings['chroot_path'] + '/etc/hosts'
@@ -1217,15 +1217,18 @@ class StageBase(TargetBase, ClearBase, GenBase):
                # optionally clean up portage configs
                if ("portage_prefix" in self.settings and
                        "sticky-config" not in self.settings["options"]):
-                       for _dir in "keywords", "mask", "unmask", "use":
-                               target = pjoin([self.settings['chroot_path'],
-                                       "/etc/portage/package.%s" % _dir,
-                                       self.settings["portage_prefix"]])
+                       log.debug("clean(), portage_preix = %s, no 
sticky-config", self.settings["portage_prefix"])
+                       for _dir in "accept_keywords", "keywords", "mask", 
"unmask", "use":
+                               target = pjoin(self.settings["destpath"],
+                                       "etc/portage/package.%s" % _dir,
+                                       self.settings["portage_prefix"])
+                               log.notice("Clearing portage_prefix target: 
%s", target)
                                clear_path(target)
 
                # Remove our overlay
-               if os.path.exists(self.settings["chroot_path"] + 
self.settings["local_overlay"]):
-                       clear_path(self.settings["chroot_path"] + 
self.settings["local_overlay"])
+               overlay = normpath(self.settings["chroot_path"] + 
self.settings["local_overlay"])
+               if os.path.exists(overlay):
+                       clear_path(overlay)
 
                # re-write the make.conf to be sure it is clean
                self.write_make_conf(setup=False)

Reply via email to