From 183320e8fbd1f05508dc8c0ec5568e949eb755a9 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Mon, 12 Jan 2009 07:34:33 -0600 Subject: [PATCH] Move set_autoresume_path() from catalyst.target.generic_stage to catalyst.target.generic --- ChangeLog | 6 ++++++ modules/catalyst/target/generic.py | 12 ++++++++++++ modules/catalyst/target/generic_stage.py | 10 ---------- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad3a0074..01584827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,12 @@ # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS) # Distributed under the GPL v2 + 12 Jan 2009; Andrew Gaffney + modules/catalyst/target/generic.py, + modules/catalyst/target/generic_stage.py: + Move set_autoresume_path() from catalyst.target.generic_stage to + catalyst.target.generic + 12 Jan 2009; Andrew Gaffney modules/catalyst/target/generic_stage.py, modules/catalyst/target/grp.py, modules/catalyst/target/livecd_stage1.py, diff --git a/modules/catalyst/target/generic.py b/modules/catalyst/target/generic.py index cd2d7e21..6bcec8be 100644 --- a/modules/catalyst/target/generic.py +++ b/modules/catalyst/target/generic.py @@ -3,6 +3,7 @@ The toplevel class for generic_stage_target. This is about as generic as we get. """ import catalyst +from catalyst.output import * class generic_target: @@ -12,6 +13,17 @@ class generic_target: self.env={} self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" + def set_autoresume_path(self): + self.settings["autoresume_path"] = catalyst.util.normpath(self.settings["storedir"] + \ + "/tmp/" + self.settings["rel_type"] + "/" + ".autoresume-" + \ + self.settings["target"] + "-" + self.settings["subarch"] + "-" + \ + self.settings["version_stamp"] + "/") + if self.check_autoresume(): + msg("The autoresume path is " + self.settings["autoresume_path"]) + if not os.path.exists(self.settings["autoresume_path"]): + os.makedirs(self.settings["autoresume_path"],0755) + + def check_autoresume(self, step=None): if "AUTORESUME" in self.settings: if step: diff --git a/modules/catalyst/target/generic_stage.py b/modules/catalyst/target/generic_stage.py index a531c9e1..64ad7725 100644 --- a/modules/catalyst/target/generic_stage.py +++ b/modules/catalyst/target/generic_stage.py @@ -409,16 +409,6 @@ class generic_stage_target(generic_target): "/tmp/"+self.settings["target_subpath"]+"/") self.chroot_lock=catalyst.lock.LockDir(self.settings["chroot_path"]) - def set_autoresume_path(self): - self.settings["autoresume_path"]=catalyst.util.normpath(self.settings["storedir"]+\ - "/tmp/"+self.settings["rel_type"]+"/"+".autoresume-"+\ - self.settings["target"]+"-"+self.settings["subarch"]+"-"+\ - self.settings["version_stamp"]+"/") - if self.check_autoresume(): - print "The autoresume path is " + self.settings["autoresume_path"] - if not os.path.exists(self.settings["autoresume_path"]): - os.makedirs(self.settings["autoresume_path"],0755) - def set_controller_file(self): self.settings["controller_file"]=catalyst.util.normpath(self.settings["sharedir"]+\ "/targets/"+self.settings["target"]+"/"+self.settings["target"]+\ -- 2.26.2