# 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,
# 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.
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"]
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
-