commit:     b267ba9b28953df3ba6528e8cf189527b037fc1d
Author:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Thu Jul 23 22:25:17 2020 +0000
Commit:     Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Jul 24 13:34:54 2020 +0000
URL:        https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=b267ba9b

stagebase: Extend cleanup logic to more directories

Needed for FEATURES management (switching off pid namespaces in qemu)
and for testing build system hacks (like building python single-threaded
to avoid hangs).

Signed-off-by: Andreas K. Hüttel <dilfridge <AT> gentoo.org>

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

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 0d3a418b..345fe1db 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1138,13 +1138,19 @@ class StageBase(TargetBase, ClearBase, GenBase):
                 "sticky-config" not in self.settings["options"]):
             log.debug("clean(), portage_preix = %s, no sticky-config",
                       self.settings["portage_prefix"])
-            for _dir in "accept_keywords", "keywords", "mask", "unmask", "use":
+            for _dir in "package.accept_keywords", "package.keywords", 
"package.mask", "package.unmask", "package.use", "package.env", "env":
                 target = pjoin(self.settings["destpath"],
-                               "etc/portage/package.%s" % _dir,
+                               "etc/portage/%s" % _dir,
                                self.settings["portage_prefix"])
                 log.notice("Clearing portage_prefix target: %s", target)
                 clear_path(target)
 
+        # Remove hacks that should *never* go into stages
+        target = pjoin(self.settings["destpath"], "etc/portage/patches")
+        if os.path.exists(target):
+            log.warning("You've been hacking. Clearing target patches: %s", 
target)
+            clear_path(target)
+
         # Remove our overlay
         overlay = normpath(
             self.settings["chroot_path"] + self.settings["local_overlay"])

Reply via email to