commit: 9f8dec72a371f7b60af1b1669d112c0d5c13b728
Author: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 24 12:35:09 2020 +0000
Commit: Andreas K. Hüttel <dilfridge <AT> gentoo <DOT> org>
CommitDate: Fri Jul 24 13:33:53 2020 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=9f8dec72
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 0ddd359f..afeda722 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1253,13 +1253,19 @@ class StageBase(TargetBase, ClearBase, GenBase):
if ("portage_prefix" in self.settings and
"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"])
if os.path.exists(overlay):