Reverting my nasty spaces->tabs mess-up and pushing out 2.0_rc4 quickly.
[catalyst.git] / modules / stage2_target.py
1 # Copyright 1999-2005 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage2_target.py,v 1.7 2005/12/02 19:37:02 wolf31o2 Exp $
4
5 """
6 Builder class for a stage2 installation tarball build.
7 """
8
9 from catalyst_support import *
10 from generic_stage_target import *
11
12 class stage2_target(generic_stage_target):
13         def __init__(self,spec,addlargs):
14                 self.required_values=[]
15                 self.valid_values=[]
16                 generic_stage_target.__init__(self,spec,addlargs)
17         def set_root_path(self):
18                # ROOT= variable for emerges
19                 self.settings["root_path"]=normpath("/tmp/stage1root")
20
21         def set_source_path(self):
22             self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/"+self.settings["root_path"]+"/")
23
24             # reset the root path so the preclean doesnt fail
25             generic_stage_target.set_root_path(self)
26
27             if os.path.isdir(self.settings["source_path"]):
28                 print "\nUsing seed-stage from "+self.settings["source_path"]
29                 print "Delete this folder if you wish to use a seed stage tarball instead\n"
30             else:
31                 self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
32                 if os.path.isfile(self.settings["source_path"]):
33                         if os.path.exists(self.settings["source_path"]):
34                                  self.settings["source_path_md5sum"]=calc_md5(self.settings["source_path"])
35
36 def register(foo):
37         foo.update({"stage2":stage2_target})
38         return foo