see changelog
authorJohn P. Davis <zhen@gentoo.org>
Wed, 2 Jun 2004 06:35:29 +0000 (06:35 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Wed, 2 Jun 2004 06:35:29 +0000 (06:35 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@385 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/snapshot_target.py

index 85ea9861bb68357df3d8d4e5de7a7f70f86a2bb0..ad712b6785423c8cab0d4d5391e82aa0da9936a8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,11 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.56 2004/05/27 16:41:36 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.57 2004/06/02 06:35:29 zhen Exp $
+
+  02 Jun 2004; John Davis <zhen@gentoo.org> modules/snapshot_target.py:
+  Fixes to address bugs #51072 and #52045. The snapshot logic was tweaked to be
+  more efficient, and I added a new snapshot specfile option, portdir_overlay.
+  It should be a full path pointing to a portage overlay dir.
 
   27 May 2004; John Davis <zhen@gentoo.org>
   livecd/cdtar/silo-1.3.1-cdtar.tar.bz2,
index e6934ed01454d5f86a2083643fa509c1430abafc..2dff87caed295b9da3d0d281df74accb7eaba9fd 100644 (file)
@@ -1,6 +1,6 @@
 # Distributed under the GNU General Public License version 2
 # Copyright 2003-2004 Gentoo Technologies, Inc.
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.1 2004/05/17 01:56:19 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.2 2004/06/02 06:35:29 zhen Exp $
 
 """
 Builder class for snapshots.
@@ -14,7 +14,7 @@ from stat import *
 class snapshot_target(generic_target):
        def __init__(self,myspec,addlargs):
                self.required_values=["version_stamp","target"]
-               self.valid_values=["version_stamp","target"]
+               self.valid_values=["version_stamp","target","portdir_overlay"]
                generic_target.__init__(self,myspec,addlargs)
                self.settings=myspec
                self.settings["target_subpath"]="portage-"+self.settings["version_stamp"]
@@ -31,20 +31,21 @@ class snapshot_target(generic_target):
                self.setup()
                print "Creating Portage tree snapshot "+self.settings["version_stamp"]+" from "+self.settings["portdir"]+"..."
                mytmp=self.settings["tmp_path"]
-               if os.path.exists(mytmp):
-                       cmd("rm -rf "+mytmp,"Could not remove existing directory: "+mytmp)
-               os.makedirs(mytmp)
-               cmd("rsync -a --exclude /packages/ --exclude /distfiles/ --exclude CVS/ "+self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure")
+               if not os.path.exists(mytmp):
+                       os.makedirs(mytmp)
+               
+               cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude CVS/ "+self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure")
+               if self.settings.has_key("portdir_overlay"):
+                       cmd("rsync -a --exclude /packages/ --exclude /distfiles/ --exclude CVS/ "+self.settings["portdir_overlay"]+"/ "+mytmp+"/portage/","Snapshot/ overlay addition failure")
+                       
                print "Compressing Portage snapshot tarball..."
                cmd("tar cjf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage","Snapshot creation failure")
                self.cleanup()
+               print "snapshot: complete!"
 
        def cleanup(self):
-               print "Cleaning up temporary snapshot directory..."
-               #Be a good citizen and clean up after ourselves
-               cmd("rm -rf "+self.settings["tmp_path"],"Snapshot cleanup failure")
+               print "Cleaning up..."
                        
 def register(foo):
        foo.update({"snapshot":snapshot_target})
        return foo
-