# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 13 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/target/snapshot.py:
+ Reorganize init for snapshot target
+
13 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/util.py:
Try to import portage.util before portage_util
"""
import os
-from generic_stage import *
import catalyst
from catalyst.spawn import cmd
from catalyst.output import *
-class snapshot_target(generic_target):
+class snapshot_target(catalyst.target.generic.generic_target):
+
def __init__(self,myspec,addlargs):
- self.required_values=["version_stamp","target"]
- self.valid_values=["version_stamp","target"]
+ self.required_values = ["version_stamp","target"]
+ self.valid_values = ["version_stamp","target"]
+
+ catalyst.target.generic.generic_target.__init__(self)
- generic_target.__init__(self)
-# self.settings=myspec
+ def setup(self):
self.settings["target_subpath"]="portage"
st=self.settings["storedir"]
self.settings["snapshot_path"]=catalyst.util.normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\
+".tar.bz2")
self.settings["tmp_path"]=catalyst.util.normpath(st+"/tmp/"+self.settings["target_subpath"])
- def setup(self):
x=catalyst.util.normpath(self.settings["storedir"]+"/snapshots")
if not os.path.exists(x):
os.makedirs(x)