From e6f134b3ed30a6c6e5808ae0e5198cf94c49b457 Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Mon, 24 Dec 2012 14:23:32 +0200 Subject: [PATCH 1/1] Fix a bug in rsync The exclude patterns should contain relative to the source paths --- image_creator/bundle_volume.py | 3 ++- image_creator/rsync.py | 1 - 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/image_creator/bundle_volume.py b/image_creator/bundle_volume.py index fde1e00..5b94c1c 100644 --- a/image_creator/bundle_volume.py +++ b/image_creator/bundle_volume.py @@ -349,7 +349,8 @@ class BundleVolume(): [(mapped[i], filesystems[i].mpoint) for i in mapped.keys()] ) exclude = self._to_exclude() + [image] - rsync = Rsync('/', target, exclude) + rsync = Rsync('/', target, + map(lambda p: os.path.relpath(p, '/'), exclude)) msg = "Copying host files into the image" rsync.archive().run(self.out, msg) diff --git a/image_creator/rsync.py b/image_creator/rsync.py index 22d3ad7..7c869c2 100644 --- a/image_creator/rsync.py +++ b/image_creator/rsync.py @@ -55,7 +55,6 @@ class Rsync: dry_run = subprocess.Popen(cmd + ['-n', self.src, self.dest], shell=False, stdout=subprocess.PIPE, bufsize=0) - print "%r" % (cmd + ['-n', self.src, self.dest]) total = 0 for line in iter(dry_run.stdout.readline, b''): total += 1 -- 1.7.10.4