Added support for livecd-stage2 to use a snapshot or livecd-stage1 image
authorEric Edgar <rocket@gentoo.org>
Mon, 11 Apr 2005 20:44:47 +0000 (20:44 +0000)
committerEric Edgar <rocket@gentoo.org>
Mon, 11 Apr 2005 20:44:47 +0000 (20:44 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@599 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/livecd_stage2_target.py

index 920c8a5a2bd0a1de54fe48ce1aaccf9e2cd8f93b..694b15096101a65b26a523d281f80d24f08474ca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.216 2005/04/11 20:05:40 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.217 2005/04/11 20:44:47 rocket Exp $
+
+  11 Apr 2005; Eric Edgar <rocket@gentoo.org>
+  modules/livecd_stage2_target.py:
+  Added support for livecd-stage2 to use a snapshot or livecd-stage1 image
 
   11 Apr 2005; Eric Edgar <rocket@gentoo.org>
   modules/generic_stage_target.py, modules/livecd_stage1_target.py,
index 9682b6106eee8ee3a1bf8a5d447176b2b857068e..04da3821aa5e5e31fe6ef20e0dd47cd48957b79f 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2004 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.32 2005/04/11 20:05:40 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.33 2005/04/11 20:44:47 rocket Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -33,29 +33,35 @@ class livecd_stage2_target(generic_stage_target):
            self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]
                
        def set_source_path(self):
-           self.settings["source_path"]=self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]
+           self.settings["source_path"]=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_md5sum"]=calc_md5(self.settings["source_path"])
+           else:
+               self.settings["source_path"]=self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]
        
        def set_spec_prefix(self):
            self.settings["spec_prefix"]="livecd"
 
                
        def unpack(self):
-               if self.settings.has_key("AUTORESUME") \
-                       and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_unpack"):
-                       print "Resume point detected, skipping unpack operation..."
+               if not os.path.isdir(self.settings["source_path"]):
+                       generic_stage_target.unpack(self)
                else:
-                                                                        
-                       if not os.path.exists(self.settings["chroot_path"]):
-                               os.makedirs(self.settings["chroot_path"])
+                   if self.settings.has_key("AUTORESUME") \
+                           and os.path.exists(self.settings["chroot_path"]+"/tmp/.clst_unpack"):
+                           print "Resume point detected, skipping unpack operation..."
+                   else:
+                           if not os.path.exists(self.settings["chroot_path"]):
+                                   os.makedirs(self.settings["chroot_path"])
                                
-                       print "Copying livecd-stage1 result to new livecd-stage2 work directory..."
-                       cmd("rsync -a --delete "+self.settings["source_path"]+"/* "+self.settings["chroot_path"],\
-                               "Error copying initial livecd-stage2")
-                       touch(self.settings["chroot_path"]+"/tmp/.clst_unpack")
-
-                       # Create the dir_setup autoresume point as the rsync --delete probably deleted it
-                       touch(self.settings["chroot_path"]+"/tmp/.clst_dir_setup")
+                           print "Copying livecd-stage1 result to new livecd-stage2 work directory..."
+                           cmd("rsync -a --delete "+self.settings["source_path"]+"/* "+self.settings["chroot_path"],\
+                                   "Error copying initial livecd-stage2")
+                           touch(self.settings["chroot_path"]+"/tmp/.clst_unpack")
 
+                           # Create the dir_setup autoresume point as the rsync --delete probably deleted it
+                           touch(self.settings["chroot_path"]+"/tmp/.clst_dir_setup")
         
        def run_local(self):
                # first clean up any existing target stuff