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 0D36313835B for ; Thu, 29 Oct 2020 03:33:28 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id ACEC6E0980; Thu, 29 Oct 2020 03:33:26 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (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 832B0E0980 for ; Thu, 29 Oct 2020 03:33:26 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (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 CB292340E86 for ; Thu, 29 Oct 2020 03:33:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 467273BD for ; Thu, 29 Oct 2020 03:33:23 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1603941806.13d714d9ba25377b2d071ed17c2a301814321d3b.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:pending/mattst88 commit in: catalyst/base/, catalyst/targets/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/targets/embedded.py catalyst/targets/livecd_stage1.py catalyst/targets/livecd_stage2.py catalyst/targets/netboot.py catalyst/targets/stage1.py catalyst/targets/stage4.py X-VCS-Directories: catalyst/targets/ catalyst/base/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 13d714d9ba25377b2d071ed17c2a301814321d3b X-VCS-Branch: pending/mattst88 Date: Thu, 29 Oct 2020 03:33:23 +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-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: fb1132b5-c1d3-4371-ad1a-d7656f07af15 X-Archives-Hash: d31148479257eac1f488bb2ed3cb547e commit: 13d714d9ba25377b2d071ed17c2a301814321d3b Author: Matt Turner gentoo org> AuthorDate: Thu Oct 29 03:08:04 2020 +0000 Commit: Matt Turner gentoo org> CommitDate: Thu Oct 29 03:23:26 2020 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=13d714d9 catalyst: Split action_sequence into prepare/build/finish Signed-off-by: Matt Turner gentoo.org> catalyst/base/stagebase.py | 24 +++++++++++++++--------- catalyst/targets/embedded.py | 6 +++++- catalyst/targets/livecd_stage1.py | 6 +++++- catalyst/targets/livecd_stage2.py | 10 +++++++--- catalyst/targets/netboot.py | 6 +++++- catalyst/targets/stage1.py | 12 ++++++------ catalyst/targets/stage4.py | 6 +++++- 7 files changed, 48 insertions(+), 22 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 2e06a988..cdc5a8a9 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -63,7 +63,9 @@ class StageBase(TargetBase, ClearBase, GenBase): "portage_overlay", "portage_prefix", ]) - self.action_sequence = [] + self.prepare_sequence = [] + self.build_sequence = [] + self.finish_sequence = [] self.set_valid_build_kernel_vars(addlargs) TargetBase.__init__(self, myspec, addlargs) @@ -477,36 +479,40 @@ class StageBase(TargetBase, ClearBase, GenBase): Or it calls the normal set_action_sequence() for the target stage. """ if "purgeonly" in self.settings["options"]: - self.action_sequence.append("remove_chroot") + self.build_sequence.append("remove_chroot") return self.set_action_sequence() def set_action_sequence(self): """Set basic stage1, 2, 3 action sequences""" - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", "run_local", "preclean", "unbind", + ]) + self.finish_sequence.extend([ "clean", ]) self.set_completion_action_sequences() def set_completion_action_sequences(self): if "fetch" not in self.settings["options"]: - self.action_sequence.append("capture") + self.finish_sequence.append("capture") if "keepwork" in self.settings["options"]: - self.action_sequence.append("clear_autoresume") + self.finish_sequence.append("clear_autoresume") elif "seedcache" in self.settings["options"]: - self.action_sequence.append("remove_autoresume") + self.finish_sequence.append("remove_autoresume") else: - self.action_sequence.append("remove_autoresume") - self.action_sequence.append("remove_chroot") + self.finish_sequence.append("remove_autoresume") + self.finish_sequence.append("remove_chroot") def set_use(self): use = self.settings["spec_prefix"] + "/use" @@ -1368,7 +1374,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.purge() failure = False - for x in self.action_sequence: + for x in self.prepare_sequence + self.build_sequence + self.finish_sequence: log.notice('--- Running action sequence: %s', x) sys.stdout.flush() try: diff --git a/catalyst/targets/embedded.py b/catalyst/targets/embedded.py index 75eb68e4..1314ce7c 100644 --- a/catalyst/targets/embedded.py +++ b/catalyst/targets/embedded.py @@ -41,11 +41,13 @@ class embedded(StageBase): StageBase.__init__(self, spec, addlargs) def set_action_sequence(self): - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "config_profile_link", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", @@ -55,6 +57,8 @@ class embedded(StageBase): "fsscript", "unmerge", "unbind", + ]) + self.finish_sequence.extend([ "remove", "empty", "clean", diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py index 9dbfa506..81367053 100644 --- a/catalyst/targets/livecd_stage1.py +++ b/catalyst/targets/livecd_stage1.py @@ -23,16 +23,20 @@ class livecd_stage1(StageBase): StageBase.__init__(self, spec, addlargs) def set_action_sequence(self): - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "config_profile_link", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", "build_packages", "unbind", + ]) + self.finish_sequence.extend([ "clean", ]) self.set_completion_action_sequences() diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py index c9b5ce08..f6c14919 100644 --- a/catalyst/targets/livecd_stage2.py +++ b/catalyst/targets/livecd_stage2.py @@ -87,11 +87,13 @@ class livecd_stage2(StageBase): print_traceback=True) def set_action_sequence(self): - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "config_profile_link", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", @@ -99,7 +101,7 @@ class livecd_stage2(StageBase): "build_kernel" ]) if "fetch" not in self.settings["options"]: - self.action_sequence.extend([ + self.build_sequence.extend([ "bootloader", "preclean", "livecd_update", @@ -108,6 +110,8 @@ class livecd_stage2(StageBase): "rcupdate", "unmerge", "unbind", + ]) + self.finish_sequence.extend([ "remove", "empty", "clean", @@ -115,4 +119,4 @@ class livecd_stage2(StageBase): "setup_overlay", "create_iso", ]) - self.action_sequence.append("clear_autoresume") + self.finish_sequence.append("clear_autoresume") diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py index e5c6d43c..9a0a4156 100644 --- a/catalyst/targets/netboot.py +++ b/catalyst/targets/netboot.py @@ -160,11 +160,13 @@ class netboot(StageBase): self.resume.enable("empty") def set_action_sequence(self): - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "config_profile_link", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", @@ -177,6 +179,8 @@ class netboot(StageBase): "remove", "empty", "unbind", + ]) + self.finish_sequence.extend([ "clean", "clear_autoresume", ]) diff --git a/catalyst/targets/stage1.py b/catalyst/targets/stage1.py index 89b30fe1..be3eae93 100644 --- a/catalyst/targets/stage1.py +++ b/catalyst/targets/stage1.py @@ -87,15 +87,15 @@ class stage1(StageBase): chroot for re-use in stage2 without the need to unpack it. ''' if "fetch" not in self.settings["options"]: - self.action_sequence.append("capture") + self.finish_sequence.append("capture") if "keepwork" in self.settings["options"]: - self.action_sequence.append("clear_autoresume") + self.finish_sequence.append("clear_autoresume") elif "seedcache" in self.settings["options"]: - self.action_sequence.append("remove_autoresume") - self.action_sequence.append("clean_stage1") + self.finish_sequence.append("remove_autoresume") + self.finish_sequence.append("clean_stage1") else: - self.action_sequence.append("remove_autoresume") - self.action_sequence.append("remove_chroot") + self.finish_sequence.append("remove_autoresume") + self.finish_sequence.append("remove_chroot") def clean_stage1(self): '''seedcache is enabled, so salvage the /tmp/stage1root, diff --git a/catalyst/targets/stage4.py b/catalyst/targets/stage4.py index bb20be79..78a5c780 100644 --- a/catalyst/targets/stage4.py +++ b/catalyst/targets/stage4.py @@ -39,11 +39,13 @@ class stage4(StageBase): self.settings["cleanables"].remove('/etc/resolv.conf') def set_action_sequence(self): - self.action_sequence.extend([ + self.prepare_sequence.extend([ "unpack", "config_profile_link", "setup_confdir", "portage_overlay", + ]) + self.build_sequence.extend([ "bind", "chroot_setup", "setup_environment", @@ -56,6 +58,8 @@ class stage4(StageBase): "rcupdate", "unmerge", "unbind", + ]) + self.finish_sequence.extend([ "remove", "empty", "clean",