From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 24769139083 for ; Wed, 22 Nov 2017 15:52:54 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 65899E0ED8; Wed, 22 Nov 2017 15:52:49 +0000 (UTC) Received: from smtp.gentoo.org (dev.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 39BDBE0ED8 for ; Wed, 22 Nov 2017 15:52:49 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8DAD4340FBF for ; Wed, 22 Nov 2017 15:52:47 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 0AEA8A3D6 for ; Wed, 22 Nov 2017 15:52:45 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1511313382.1eb7a1208dfe34d126f0f700b62214f01042b271.dolsen@gentoo> Subject: [gentoo-commits] proj/catalyst:pending commit in: catalyst/, targets/stage3/, catalyst/base/, targets/stage2/, targets/support/, ... X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/fileops.py targets/stage2/stage2-controller.sh targets/stage3/stage3-controller.sh targets/stage4/stage4-controller.sh targets/support/functions.sh X-VCS-Directories: targets/stage4/ targets/support/ catalyst/base/ targets/stage2/ targets/stage3/ catalyst/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 1eb7a1208dfe34d126f0f700b62214f01042b271 X-VCS-Branch: pending Date: Wed, 22 Nov 2017 15:52:45 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 64272bd2-7251-4859-a84e-c970ac918dd5 X-Archives-Hash: 4a9bcdd653ab4a2cbd6c49d525e5f6a6 Message-ID: <20171122155245.GclYsd-0qmRUWWjdWFz7GFH-22Mbvu8Y_HGg6PVZqs0@z> commit: 1eb7a1208dfe34d126f0f700b62214f01042b271 Author: Brian Dolbec gentoo org> AuthorDate: Sun Mar 19 22:06:11 2017 +0000 Commit: Brian Dolbec gentoo 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