Fix catalyst so it fully disables snapcache when its not specified in the config...
authorEric Edgar <rocket@gentoo.org>
Thu, 6 Oct 2005 17:26:51 +0000 (17:26 +0000)
committerEric Edgar <rocket@gentoo.org>
Thu, 6 Oct 2005 17:26:51 +0000 (17:26 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@847 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py

index dd50b97872bedfd5adc4dfc366542c44c0b498b6..a4dd48ad3e435ec63a694a779068ed119cba1cd5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.339 2005/10/06 15:50:02 wolf31o2 Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.340 2005/10/06 17:26:51 rocket Exp $
+
+  06 Oct 2005; Eric Edgar <rocket@gentoo.org>
+  modules/generic_stage_target.py:
+  Fix catalyst so it fully disables snapcache when its not specified in the
+  config file
 
   06 Oct 2005; Chris Gianelloni <wolf31o2@gentoo.org> catalyst,
   examples/livecd-stage2_template.spec:
index 0fc2689becbe3a4ab0015b00eb079765ccbc37dd..23a4dd3bc56957d054e3b0dca48fb43c2fb06523 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2005 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.59 2005/09/15 15:17:27 rocket Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.60 2005/10/06 17:26:51 rocket Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -530,10 +530,10 @@ class generic_stage_target(generic_target):
 
        def unpack_snapshot(self):
                unpack=True
-               snapshot_cache_md5sum=read_from_clst(self.settings["snapshot_cache_path"]+"catalyst-md5sum")
                snapshot_md5sum=read_from_clst(self.settings["autoresume_path"]+"unpack_portage")
                
                if self.settings.has_key("SNAPCACHE"): 
+                       snapshot_cache_md5sum=read_from_clst(self.settings["snapshot_cache_path"]+"catalyst-md5sum")
                        destdir=self.settings["snapshot_cache_path"]
                        unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+destdir
                        unpack_errmsg="Error unpacking snapshot"
@@ -551,7 +551,6 @@ class generic_stage_target(generic_target):
                        cleanup_msg="Cleaning up existing portage tree (This can take a long time) ..."
                        unpack_cmd="tar xjpf "+self.settings["snapshot_path"]+" -C "+self.settings["chroot_path"]+"/usr"
                        unpack_errmsg="Error unpacking snapshot"
-                       self.snapshot_lock_object=self.snapshot_lock
                
                        if self.settings.has_key("AUTORESUME") \
                        and os.path.exists(self.settings["chroot_path"]+"/usr/portage/") \
@@ -563,7 +562,8 @@ class generic_stage_target(generic_target):
                
                
                if unpack:
-                       self.snapshot_lock_object.write_lock()
+                       if self.settings.has_key("SNAPCACHE"): 
+                           self.snapshot_lock_object.write_lock()
                        if os.path.exists(destdir):
                                print cleanup_msg
                                cleanup_cmd="rm -rf "+destdir
@@ -585,7 +585,8 @@ class generic_stage_target(generic_target):
                                myf.write(self.settings["snapshot_path_md5sum"])
                                myf.close()
                        
-                       self.snapshot_lock_object.unlock()
+                       if self.settings.has_key("SNAPCACHE"): 
+                           self.snapshot_lock_object.unlock()
 
        def config_profile_link(self):
                if self.settings.has_key("AUTORESUME") \