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 76C191382C5 for ; Sun, 20 Dec 2020 02:28:56 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BA3F4E0931; Sun, 20 Dec 2020 02:28:55 +0000 (UTC) Received: from mail-qk1-f179.google.com (mail-qk1-f179.google.com [209.85.222.179]) (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 B3E43E0931 for ; Sun, 20 Dec 2020 02:28:55 +0000 (UTC) Received: by mail-qk1-f179.google.com with SMTP id 19so6024547qkm.8 for ; Sat, 19 Dec 2020 18:28:55 -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=LRCMHvf2Rd/8ZzUu/Yi+DdIyCG4XDlXMDKbblTe2g2I=; b=Jj0aD3B5Jc4L/EhzrzyujIDWoVvrZKgavUPh2Ntyc/054rxsdQGK1pK3dK4TufiKYW swNcbphVWDMFP0UC6FBhHKbJIXSBbeV/5uCIW+IS0zqqFlJ6dFYBRNWWIVDTaqoWO7GN wX35GbPWJQuof6m9xu/bXZ8hyaX7Qi1rbXCGPKcEimsGjeE9J1C9jRLXs1R6uRIvi2Qj +HzctH+oAx+iPN1SQBo+1zY1sIQIakTGu4hy9eGUxDQLddRofOf5afO9tztvY4k8Ak2i cgMAxCGYCab6QaiHJ03zSFXSCMP7JzBdMO3bQMZ+ZO9CwGqCT/m3uJSYJxcp4OLnluEp vBew== X-Gm-Message-State: AOAM531FBpMkU0JUlXqolFWGDo0/dzBsUSb0skQ6qgg/BMm7EP/93XFV +uWVBB3ehA39hPh2DGD797AnUDbfwk7FLg== X-Google-Smtp-Source: ABdhPJxq9PkVjysirFeGG48j12DirdhSV9HGhyJ3Gzv6VH9mhmVk3OCaLQy7l+s6P+3DoM+B7pP1kQ== X-Received: by 2002:a37:56c6:: with SMTP id k189mr11586297qkb.501.1608431334715; Sat, 19 Dec 2020 18:28:54 -0800 (PST) Received: from localhost ([208.104.103.123]) by smtp.gmail.com with ESMTPSA id n7sm4036501qkg.19.2020.12.19.18.28.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 19 Dec 2020 18:28:54 -0800 (PST) From: Matt Turner To: gentoo-catalyst@lists.gentoo.org Cc: Matt Turner Subject: [gentoo-catalyst] [PATCH 2/7] catalyst: Remove set_dest_path() Date: Sat, 19 Dec 2020 21:28:43 -0500 Message-Id: <20201220022848.249207-2-mattst88@gentoo.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201220022848.249207-1-mattst88@gentoo.org> References: <20201220022848.249207-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: 648e2255-8655-42ed-9153-a2fab7a7a1bf X-Archives-Hash: 6500d773122b39741543d34b7e3386c3 root_path is always set, so half of this function was dead. The other half set the same thing as set_stage_path(). Signed-off-by: Matt Turner --- catalyst/base/stagebase.py | 20 ++++++-------------- targets/support/target_image_setup.sh | 4 ++-- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index ba6b1a1b..ed4d1227 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -154,7 +154,6 @@ class StageBase(TargetBase, ClearBase, GenBase): self.set_source_path() self.set_chroot_path() self.set_autoresume_path() - self.set_dest_path() self.set_stage_path() self.set_target_path() @@ -426,13 +425,6 @@ class StageBase(TargetBase, ClearBase, GenBase): self.generate_hash(self.settings["source_path"], "sha1") log.notice('Source path set to %s', self.settings['source_path']) - def set_dest_path(self): - if "root_path" in self.settings: - self.settings["destpath"] = normpath(self.settings["chroot_path"] + - self.settings["root_path"]) - else: - self.settings["destpath"] = normpath(self.settings["chroot_path"]) - def set_cleanables(self): self.settings['cleanables'] = [ "/etc/resolv.conf", @@ -845,7 +837,7 @@ class StageBase(TargetBase, ClearBase, GenBase): "/root_overlay"]: if os.path.exists(x): log.info('Copying root_overlay: %s', x) - cmd(['rsync', '-a', x + '/', self.settings['destpath']], + cmd(['rsync', '-a', x + '/', self.settings['stage_path']], env=self.env) def bind(self): @@ -1095,7 +1087,7 @@ class StageBase(TargetBase, ClearBase, GenBase): else: for x in self.settings["cleanables"]: log.notice('Cleaning chroot: %s', x) - clear_path(normpath(self.settings["destpath"] + x)) + clear_path(normpath(self.settings["stage_path"] + x)) # Put /etc/hosts back into place hosts_file = self.settings['chroot_path'] + '/etc/hosts' @@ -1119,14 +1111,14 @@ class StageBase(TargetBase, ClearBase, GenBase): log.debug("clean(), portage_preix = %s, no sticky-config", self.settings["portage_prefix"]) for _dir in "package.accept_keywords", "package.keywords", "package.mask", "package.unmask", "package.use", "package.env", "env": - target = pjoin(self.settings["destpath"], + target = pjoin(self.settings["stage_path"], "etc/portage/%s" % _dir, self.settings["portage_prefix"]) log.notice("Clearing portage_prefix target: %s", target) clear_path(target) # Remove hacks that should *never* go into stages - target = pjoin(self.settings["destpath"], "etc/portage/patches") + target = pjoin(self.settings["stage_path"], "etc/portage/patches") if os.path.exists(target): log.warning("You've been hacking. Clearing target patches: %s", target) clear_path(target) @@ -1172,7 +1164,7 @@ class StageBase(TargetBase, ClearBase, GenBase): self.settings[self.settings["spec_prefix"] + "/empty"].split() for x in self.settings[self.settings["spec_prefix"] + "/empty"]: - myemp = self.settings["destpath"] + x + myemp = self.settings["stage_path"] + x if not os.path.isdir(myemp) or os.path.islink(myemp): log.warning('not a directory or does not exist, ' 'skipping "empty" operation: %s', x) @@ -1192,7 +1184,7 @@ class StageBase(TargetBase, ClearBase, GenBase): # We're going to shell out for all these cleaning # operations, so we get easy glob handling. log.notice('%s: removing %s', self.settings["spec_prefix"], x) - clear_path(self.settings["destpath"] + x) + clear_path(self.settings["stage_path"] + x) try: if os.path.exists(self.settings["controller_file"]): cmd([self.settings['controller_file'], 'clean'], diff --git a/targets/support/target_image_setup.sh b/targets/support/target_image_setup.sh index fdc4a234..f9427eaf 100755 --- a/targets/support/target_image_setup.sh +++ b/targets/support/target_image_setup.sh @@ -7,11 +7,11 @@ mkdir -p "${1}" echo "Creating ${clst_fstype} filesystem" case ${clst_fstype} in squashfs) - gensquashfs -D "${clst_destpath}" -q ${clst_fsops} "${1}/image.squashfs" \ + gensquashfs -D "${clst_stage_path}" -q ${clst_fsops} "${1}/image.squashfs" \ || die "Failed to create squashfs filesystem" ;; jffs2) - mkfs.jffs2 --root="${clst_destpath}" --output="${1}/image.jffs" "${clst_fsops}" \ + mkfs.jffs2 --root="${clst_stage_path}" --output="${1}/image.jffs" "${clst_fsops}" \ || die "Failed to create jffs2 filesystem" ;; esac -- 2.26.2