Added cleanup patch for stage1/stage2 and generic_stage_target from Andrew Gaffney...
authorChris Gianelloni <wolf31o2@gentoo.org>
Wed, 22 Nov 2006 15:11:34 +0000 (15:11 +0000)
committerChris Gianelloni <wolf31o2@gentoo.org>
Wed, 22 Nov 2006 15:11:34 +0000 (15:11 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1188 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py
modules/stage1_target.py
modules/stage2_target.py

index e6cab7b479e274f79a1fb918eb49a4b0771f307c..43487b5454104aa47fb58a5b0b548b2a96ca56a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2
 # $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.664 2006/10/02 20:41:53 wolf31o2 Exp $
 
+  22 Nov 2006; Chris Gianelloni <wolf31o2@gentoo.org>
+  modules/generic_stage_target.py, modules/stage1_target.py,
+  modules/stage2_target.py:
+  Added cleanup patch for stage1/stage2 and generic_stage_target from Andrew
+  Gaffney <agaffney@gentoo.org> wrt bug #155911.
+
   22 Nov 2006; Chris Gianelloni <wolf31o2@gentoo.org>
   targets/grp/grp-chroot.sh, targets/livecd-stage1/livecd-stage1-chroot.sh,
   targets/netboot/netboot-chroot.sh, targets/netboot2/netboot2-pkg.sh,
index 8a480dfd0f29b1fa380763f5cfc9573fcb7cb034..c2a9740051a0a1e36483b165085435da5828cec8 100644 (file)
@@ -338,19 +338,15 @@ class generic_stage_target(generic_target):
                        self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/")
                else:
                        self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
-                       
                        if os.path.isfile(self.settings["source_path"]):
-                               if os.path.exists(self.settings["source_path"]):
-                                       self.settings["source_path_hash"]=generate_hash(self.settings["source_path"],\
-                                                       hash_function=self.settings["hash_function"],verbose=False)
+                               if os.path.exists(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes?
+                                       self.settings["source_path_hash"]=generate_hash(self.settings["source_path"],\
+                                               hash_function=self.settings["hash_function"],verbose=False)
+               print "Source path set to "+self.settings["source_path"]
                if os.path.isdir(self.settings["source_path"]):
-                       print "Source path set to "+self.settings["source_path"]
                        print "\tIf this is not desired, remove this directory or turn of seedcache in the options of catalyst.conf"
-                       print "\tthe source path with then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
-               else:
-                       print "Source path set to "+self.settings["source_path"]
+                       print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
 
-       
        def set_dest_path(self):
                if self.settings.has_key("root_path"):
                        self.settings["destpath"]=normpath(self.settings["chroot_path"]+self.settings["root_path"])
index 90478d23b63e055dfc233c1b3e2744829624407e..1e9b92a4f93041526bb83694209b94690a4d5878 100644 (file)
@@ -33,6 +33,8 @@ class stage1_target(generic_stage_target):
                "/usr/lib/python2.4/email", "/usr/lib/python2.4/lib-tk",\
                "/usr/share/zoneinfo"])
 
+       # XXX: How do these override_foo() functions differ from the ones in generic_stage_target and why aren't they in stage3_target?
+
        def override_chost(self):
                if self.settings.has_key("chost"):
                        self.settings["CHOST"]=list_to_string(self.settings["chost"])
index e3f6680e83d98aed082bd52eb0d68a2c8b29c778..dbbffba79af59399302ead7176d31ff91187d101 100644 (file)
@@ -12,25 +12,23 @@ class stage2_target(generic_stage_target):
                self.required_values=[]
                self.valid_values=[]
                generic_stage_target.__init__(self,spec,addlargs)
-       def set_root_path(self):
-               # ROOT= variable for emerges
-               self.settings["root_path"]=normpath("/tmp/stage1root")
-
+               
        def set_source_path(self):
-               self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/"+self.settings["root_path"]+"/")
-
-               # reset the root path so the preclean doesnt fail
-               generic_stage_target.set_root_path(self)
-
-               if os.path.isdir(self.settings["source_path"]):
-                       print "\nUsing seed-stage from "+self.settings["source_path"]
-                       print "Delete this folder if you wish to use a seed stage tarball instead\n"
+               if self.settings.has_key("SEEDCACHE") and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
+                       self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")
                else:
                        self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
                        if os.path.isfile(self.settings["source_path"]):
-                               if os.path.exists(self.settings["source_path"]):
-                                       self.settings["source_path_hash"]=generate_hash(self.settings["source_path"])
+                               if os.path.exists(self.settings["source_path"]): # XXX: Is this even necessary if the previous check passes?
+                                       self.settings["source_path_hash"]=generate_hash(self.settings["source_path"],\
+                                               hash_function=self.settings["hash_function"],verbose=False)
+               print "Source path set to "+self.settings["source_path"]
+               if os.path.isdir(self.settings["source_path"]):
+                       print "\tIf this is not desired, remove this directory or turn of seedcache in the options of catalyst.conf"
+                       print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
 
+       # XXX: How do these override_foo() functions differ from the ones in generic_stage_target and why aren't they in stage3_target?
+       
        def override_chost(self):
                if self.settings.has_key("chost"):
                        self.settings["CHOST"]=list_to_string(self.settings["chost"])
@@ -55,7 +53,6 @@ class stage2_target(generic_stage_target):
                                print "\tIf you break it, you buy it. Don't complain to us about it."
                                print "\tDont say we did not warn you\n"
 
-
 def register(foo):
        foo.update({"stage2":stage2_target})
        return foo