1 |
commit: d1dbb555a08951b65c21f900ace740b1a76efa51 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Dec 28 20:58:29 2017 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Dec 29 00:34:30 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=d1dbb555 |
7 |
|
8 |
stagebase.py: Fix cleaning portage_prefix errors |
9 |
|
10 |
Remove outer [ ] pair in the pjoin. |
11 |
Remove leading / in the "/etc/portage/package.%s" Ben Kohler <bkohler <AT> gmail.com> |
12 |
Add "accept_keywords" package.* entry to clean. Ben Kohler <bkohler <AT> gmail.com> |
13 |
Add extra logging info. |
14 |
Change from using chroot_path to destpath in case it is different (stage1). |
15 |
Use normpath() on some other cleanables to remove "//"'s |
16 |
|
17 |
catalyst/base/stagebase.py | 17 ++++++++++------- |
18 |
1 file changed, 10 insertions(+), 7 deletions(-) |
19 |
|
20 |
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py |
21 |
index a6a32f5a..8f9a5dbd 100644 |
22 |
--- a/catalyst/base/stagebase.py |
23 |
+++ b/catalyst/base/stagebase.py |
24 |
@@ -1207,7 +1207,7 @@ class StageBase(TargetBase, ClearBase, GenBase): |
25 |
else: |
26 |
for x in self.settings["cleanables"]: |
27 |
log.notice('Cleaning chroot: %s', x) |
28 |
- clear_path(self.settings["destpath"] + x) |
29 |
+ clear_path(normpath(self.settings["destpath"] + x)) |
30 |
|
31 |
# Put /etc/hosts back into place |
32 |
hosts_file = self.settings['chroot_path'] + '/etc/hosts' |
33 |
@@ -1217,15 +1217,18 @@ class StageBase(TargetBase, ClearBase, GenBase): |
34 |
# optionally clean up portage configs |
35 |
if ("portage_prefix" in self.settings and |
36 |
"sticky-config" not in self.settings["options"]): |
37 |
- for _dir in "keywords", "mask", "unmask", "use": |
38 |
- target = pjoin([self.settings['chroot_path'], |
39 |
- "/etc/portage/package.%s" % _dir, |
40 |
- self.settings["portage_prefix"]]) |
41 |
+ log.debug("clean(), portage_preix = %s, no sticky-config", self.settings["portage_prefix"]) |
42 |
+ for _dir in "accept_keywords", "keywords", "mask", "unmask", "use": |
43 |
+ target = pjoin(self.settings["destpath"], |
44 |
+ "etc/portage/package.%s" % _dir, |
45 |
+ self.settings["portage_prefix"]) |
46 |
+ log.notice("Clearing portage_prefix target: %s", target) |
47 |
clear_path(target) |
48 |
|
49 |
# Remove our overlay |
50 |
- if os.path.exists(self.settings["chroot_path"] + self.settings["local_overlay"]): |
51 |
- clear_path(self.settings["chroot_path"] + self.settings["local_overlay"]) |
52 |
+ overlay = normpath(self.settings["chroot_path"] + self.settings["local_overlay"]) |
53 |
+ if os.path.exists(overlay): |
54 |
+ clear_path(overlay) |
55 |
|
56 |
# re-write the make.conf to be sure it is clean |
57 |
self.write_make_conf(setup=False) |