# Distributed under the GPL v2
# $Id$
+ 13 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
+ modules/catalyst/target/snapshot.py, modules/catalyst/util.py:
+ Create catalyst.util.rsync() helper function
+
13 Sep 2009; Andrew Gaffney <agaffney@gentoo.org>
modules/catalyst/target/generic_stage.py,
modules/catalyst/target/livecd_stage1.py,
if not os.path.exists(mytmp):
os.makedirs(mytmp)
- cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-* "+\
- self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env)
+ catalyst.util.rsync(self.settings["portdir"] + "/", mytmp + "/portage/", delete=True, \
+ extra_opts="--exclude /distfiles/ --exclude /local/ --exclude CVS/ --exclude .svn --filter=H_**/files/digest-*")
msg("Compressing Portage snapshot tarball...")
cmd("tar cjf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\
except:
raise CatalystError("Could not create symlink '%s' to '%s'" % (dest, src))
+def rsync(src, dest, delete=False, extra_opts=""):
+ retval = catalyst.spawn.spawn_bash("rsync -a --delete %s %s %s" % (extra_opts, src, dest))
+ if retval != 0:
+ raise CatalystError("Could not rsync '%s' to '%s'" % (src, dest))
+
# vim: ts=4 sw=4 sta noet sts=4 ai