public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: Matt Turner <mattst88@gentoo.org>
To: gentoo-catalyst@lists.gentoo.org
Cc: Matt Turner <mattst88@gentoo.org>
Subject: [gentoo-catalyst] [PATCH 09/11] catalyst: Deduplicate the common build_sequence steps
Date: Mon, 18 Jan 2021 15:21:50 -0500	[thread overview]
Message-ID: <20210118202152.374078-9-mattst88@gentoo.org> (raw)
In-Reply-To: <20210118202152.374078-1-mattst88@gentoo.org>

This also provides a single location to add a function to all targets'
build_sequence.

Signed-off-by: Matt Turner <mattst88@gentoo.org>
---
 catalyst/base/stagebase.py        | 11 ++++++-----
 catalyst/targets/embedded.py      |  3 ---
 catalyst/targets/livecd_stage1.py |  3 ---
 catalyst/targets/livecd_stage2.py |  3 ---
 catalyst/targets/netboot.py       |  3 ---
 catalyst/targets/stage4.py        |  3 ---
 6 files changed, 6 insertions(+), 20 deletions(-)

diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py
index 3b8d3a6e..40b60af3 100644
--- a/catalyst/base/stagebase.py
+++ b/catalyst/base/stagebase.py
@@ -90,7 +90,11 @@ class StageBase(TargetBase, ClearBase, GenBase):
             self.setup_confdir,
             self.portage_overlay,
         ]
-        self.build_sequence = []
+        self.build_sequence = [
+            self.bind,
+            self.chroot_setup,
+            self.setup_environment,
+        ]
         self.finish_sequence = []
 
         self.set_valid_build_kernel_vars(addlargs)
@@ -497,16 +501,13 @@ class StageBase(TargetBase, ClearBase, GenBase):
         Or it calls the normal set_action_sequence() for the target stage.
         """
         if "purgeonly" in self.settings["options"]:
-            self.build_sequence.append(self.remove_chroot)
+            self.build_sequence = [self.remove_chroot]
             return
         self.set_action_sequence()
 
     def set_action_sequence(self):
         """Set basic stage1, 2, 3 action sequences"""
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.run_local,
             self.preclean,
         ])
diff --git a/catalyst/targets/embedded.py b/catalyst/targets/embedded.py
index 83b17ad2..b677b226 100644
--- a/catalyst/targets/embedded.py
+++ b/catalyst/targets/embedded.py
@@ -42,9 +42,6 @@ class embedded(StageBase):
 
     def set_action_sequence(self):
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.build_kernel,
             self.build_packages,
             self.root_overlay,
diff --git a/catalyst/targets/livecd_stage1.py b/catalyst/targets/livecd_stage1.py
index 9fe95a00..dbfa54ed 100644
--- a/catalyst/targets/livecd_stage1.py
+++ b/catalyst/targets/livecd_stage1.py
@@ -24,9 +24,6 @@ class livecd_stage1(StageBase):
 
     def set_action_sequence(self):
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.build_packages,
         ])
         self.finish_sequence.extend([
diff --git a/catalyst/targets/livecd_stage2.py b/catalyst/targets/livecd_stage2.py
index ab8f4a0e..e90e9f53 100644
--- a/catalyst/targets/livecd_stage2.py
+++ b/catalyst/targets/livecd_stage2.py
@@ -87,9 +87,6 @@ class livecd_stage2(StageBase):
 
     def set_action_sequence(self):
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.run_local,
             self.build_kernel
         ])
diff --git a/catalyst/targets/netboot.py b/catalyst/targets/netboot.py
index cb5e7ae4..a2a9fcb3 100644
--- a/catalyst/targets/netboot.py
+++ b/catalyst/targets/netboot.py
@@ -159,9 +159,6 @@ class netboot(StageBase):
 
     def set_action_sequence(self):
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.build_packages,
             self.root_overlay,
             self.copy_files_to_image,
diff --git a/catalyst/targets/stage4.py b/catalyst/targets/stage4.py
index 9e53f070..f8383f75 100644
--- a/catalyst/targets/stage4.py
+++ b/catalyst/targets/stage4.py
@@ -40,9 +40,6 @@ class stage4(StageBase):
 
     def set_action_sequence(self):
         self.build_sequence.extend([
-            self.bind,
-            self.chroot_setup,
-            self.setup_environment,
             self.build_packages,
             self.build_kernel,
             self.bootloader,
-- 
2.26.2



  parent reply	other threads:[~2021-01-18 20:22 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-18 20:21 [gentoo-catalyst] [PATCH 01/11] targets: Remove unused 'enter' command Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 02/11] targets: Remove some obvious comments Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 03/11] targets: Update seed stage's sys-apps/portage Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 04/11] targets: Update BINPKG_COMPRESS to new zstd default Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 05/11] targets: Update the @changed-subslot set by default Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 06/11] catalyst: Store references to functions Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 07/11] catalyst: Call config_profile_link for all targets Matt Turner
2021-02-25 13:09   ` [gentoo-catalyst] [PATCH] Fix specifying target_profiles in repo_name:path format Daniel Cordero
2021-02-27 18:52     ` [gentoo-catalyst] " Matt Turner
2021-02-27 23:31       ` Felix Bier
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 08/11] catalyst: Deduplicate prepare_sequence assignments Matt Turner
2021-01-18 20:21 ` Matt Turner [this message]
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 10/11] catalyst: Add option to enter the chroot before building Matt Turner
2021-01-18 20:21 ` [gentoo-catalyst] [PATCH 11/11] catalyst: Remove update_seed spec option Matt Turner
2021-01-19 11:02   ` Daniel Cordero
2021-01-19 14:58     ` Matt Turner
2021-01-21  5:12       ` Matt Turner
2021-01-21 10:20       ` Daniel Cordero
2021-01-22  0:04         ` Matt Turner

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=20210118202152.374078-9-mattst88@gentoo.org \
    --to=mattst88@gentoo.org \
    --cc=gentoo-catalyst@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