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 8B5041382C5 for ; Mon, 18 Jan 2021 20:22:16 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D3D36E0855; Mon, 18 Jan 2021 20:22:15 +0000 (UTC) Received: from mail-qt1-f181.google.com (mail-qt1-f181.google.com [209.85.160.181]) (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 C9AC6E0855 for ; Mon, 18 Jan 2021 20:22:15 +0000 (UTC) Received: by mail-qt1-f181.google.com with SMTP id v5so12180105qtv.7 for ; Mon, 18 Jan 2021 12:22:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=NNE7dYwkKsHTMAYl6GpwosdpKmI/wH16fNSXcVYwM+4=; b=fbnYTdIM019jVfayootPSC8ijaMBcPLGh3sLFxg/eurMkqeKbisdCLbRWe447pDsL1 +R+gCwimHmN2zvHzzab2B/PH87lv3nFUQMnMjuu04ro/9lRbmRHssQXX2zbkEOr29vf1 MGc3ds50EiPvJ6B9zu8ESKKKmBm/m/er9teasGTflKoGKo2JoSs9veqm/TiEoIxPq4hB G1m5Mfpx8z6Cp+MSFGTYM8YWx6WCXU/cF1bT6Z/wbncAxXs7QdPbbQO6zQahTEwprl0M yWMEFd211RDSUV2+RmNvWs18G+bECB5DEVyRalqhTsniG7OwidnBCCH0OWE6zeM3RY1s Ln1Q== X-Gm-Message-State: AOAM532UnFIsgT1T38yAVH/i8usBNIjPCEpVzuYxyuFtOuFBDmXWLI8Y C7V+fz3tgDTbzUEV2qmC7uAT6weHetw= X-Google-Smtp-Source: ABdhPJxAPzoqiWubdJWu6aj/ZB3qlAkgAvhbJmnZzhBqVAZ1QWgasrmQJQaQkaEWPE10dNVo9KtoNA== X-Received: by 2002:ac8:7087:: with SMTP id y7mr1357699qto.246.1611001334896; Mon, 18 Jan 2021 12:22:14 -0800 (PST) Received: from localhost ([208.104.103.123]) by smtp.gmail.com with ESMTPSA id j142sm11604046qke.117.2021.01.18.12.22.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Jan 2021 12:22:13 -0800 (PST) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 09/11] catalyst: Deduplicate the common build_sequence steps Date: Mon, 18 Jan 2021 15:21:50 -0500 Message-Id: <20210118202152.374078-9-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210118202152.374078-1-mattst88@gentoo.org> References: <20210118202152.374078-1-mattst88@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-catalyst@lists.gentoo.org Reply-to: gentoo-catalyst@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Archives-Salt: 99ae50e3-58cd-4297-83a4-109baeecb3b0 X-Archives-Hash: 48e70ec796ddfbdd5cddc76d0aad2771 This also provides a single location to add a function to all targets' build_sequence. Signed-off-by: Matt Turner --- 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