[Piuparts-devel] [PATCH] use tar --one-file-system, exclude /tmp/scripts

Andreas Beckmann debian at abeckmann.de
Sat Nov 5 21:42:51 UTC 2011


instead of setting explicit excludes for /proc, use
  tar --one-file-system ...
to exclude other mountpoints (from --bindmount) in addition to /proc
(may not work if --bindmount and --tmpdir are on the same filesystem)

exclude /tmp/scripts from the tarball to allow the tarball to be used with
different custom scripts later on - they will be copied over later anyway,
but the old ones won't be removed

Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

---
 piuparts.py |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/piuparts.py b/piuparts.py
index a731af2..f673ab5 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -645,7 +645,7 @@ class Chroot:
         """Tar and compress all files in the chroot."""
         logging.debug("Saving %s to %s." % (self.name, result))
 
-        run(['tar', '--exclude', './proc/*', '-czf', result, '-C', self.name, './'])
+        run(['tar', '-czf', result, '--exclude', 'tmp/scripts', '--one-file-system', '-C', self.name, './'])
 
     def unpack_from_tgz(self, tarball):
         """Unpack a tarball to a chroot."""
-- 
tg: (5763796..) t/feat/tar--one-file-system (depends on: develop)



More information about the Piuparts-devel mailing list