From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, targets/stage3/, catalyst/base/, targets/stage2/, targets/support/, ...
Date: Wed, 22 Nov 2017 15:52:45 +0000 (UTC) [thread overview]
Message-ID: <1511313382.1eb7a1208dfe34d126f0f700b62214f01042b271.dolsen@gentoo> (raw)
Message-ID: <20171122155245.GclYsd-0qmRUWWjdWFz7GFH-22Mbvu8Y_HGg6PVZqs0@z> (raw)
commit: 1eb7a1208dfe34d126f0f700b62214f01042b271
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sun Mar 19 22:06:11 2017 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Nov 22 01:16:22 2017 +0000
URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=1eb7a120
Unify stage cleaning
Move the clear_portage() code to the python side clean().
Put that code behind the sticky-config option.
catalyst/base/stagebase.py | 9 +++++++++
catalyst/fileops.py | 2 +-
targets/stage2/stage2-controller.sh | 1 -
targets/stage3/stage3-controller.sh | 1 -
targets/stage4/stage4-controller.sh | 1 -
targets/support/functions.sh | 11 -----------
6 files changed, 10 insertions(+), 15 deletions(-)
diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index a7aa7f41..7a41973c 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -1201,6 +1201,15 @@ class StageBase(TargetBase, ClearBase, GenBase):
if os.path.exists(hosts_file + '.catalyst'):
os.rename(hosts_file + '.catalyst', hosts_file)
+ # 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"]])
+ 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"])
diff --git a/catalyst/fileops.py b/catalyst/fileops.py
index d2bd4530..ef4ee8d1 100644
--- a/catalyst/fileops.py
+++ b/catalyst/fileops.py
@@ -71,7 +71,7 @@ def clear_dir(target, mode=0o755, chg_flags=False, remove=False,
mystat = None
if os.path.isdir(target) and not os.path.islink(target):
- log.info('Emptying directory: %s', target)
+ log.notice('Emptying directory: %s', target)
# stat the dir, delete the dir, recreate the dir and set
# the proper perms and ownership
try:
diff --git a/targets/stage2/stage2-controller.sh b/targets/stage2/stage2-controller.sh
index 2eee79f3..25e51208 100755
--- a/targets/stage2/stage2-controller.sh
+++ b/targets/stage2/stage2-controller.sh
@@ -17,7 +17,6 @@ case $1 in
;;
preclean)
- clear_portage
exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh
;;
diff --git a/targets/stage3/stage3-controller.sh b/targets/stage3/stage3-controller.sh
index 2d415e40..df1479ea 100755
--- a/targets/stage3/stage3-controller.sh
+++ b/targets/stage3/stage3-controller.sh
@@ -16,7 +16,6 @@ case $1 in
;;
preclean)
- clear_portage
exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh
;;
diff --git a/targets/stage4/stage4-controller.sh b/targets/stage4/stage4-controller.sh
index 6a876c82..d42f302f 100755
--- a/targets/stage4/stage4-controller.sh
+++ b/targets/stage4/stage4-controller.sh
@@ -41,7 +41,6 @@ case $1 in
;;
preclean)
- clear_portage
exec_in_chroot ${clst_shdir}/${clst_target}/${clst_target}-preclean-chroot.sh ${clst_root_path}
;;
diff --git a/targets/support/functions.sh b/targets/support/functions.sh
index ac4ec6c7..cca2fd82 100755
--- a/targets/support/functions.sh
+++ b/targets/support/functions.sh
@@ -16,17 +16,6 @@ delete_from_chroot(){
fi
}
-clear_portage() {
- if [ -n "${clst_portage_prefix}" ]; then
- for dir in "keywords", "mask", "unmask", "use"; do
- [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] &&
- echo "Clear ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}"
- [ -d ${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix} ] &&
- rm -R "${clst_chroot_path}/etc/portage/package.${dir}/${clst_portage_prefix}"
- done
- fi
-}
-
exec_in_chroot(){
# Takes the full path to the source file as its argument
# copies the file to the /tmp directory of the chroot
next reply other threads:[~2017-11-22 15:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-29 17:20 Brian Dolbec [this message]
2017-11-22 15:52 ` [gentoo-commits] proj/catalyst:pending commit in: catalyst/, targets/stage3/, catalyst/base/, targets/stage2/, targets/support/, Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1511313382.1eb7a1208dfe34d126f0f700b62214f01042b271.dolsen@gentoo \
--to=dolsen@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox