[Piuparts-commits] [SCM] piuparts git repository branch, master, updated. 0.47-41-ga9fc1b0

Andreas Beckmann debian at abeckmann.de
Fri Nov 30 11:20:42 UTC 2012


The following commit has been merged in the master branch:
commit 95a393eb74fc0d8e8defb08d770492320a08b39d
Author: Andreas Beckmann <debian at abeckmann.de>
Date:   Sun Jul 22 12:30:42 2012 +0200

    p: mark piuparts tmpdirs with a .piuparts.tmpdir file
    
    Signed-off-by: Andreas Beckmann <debian at abeckmann.de>

diff --git a/debian/changelog b/debian/changelog
index 5182369..a32d1c8 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -11,6 +11,7 @@ piuparts (0.48) UNRELEASED; urgency=low
     - Add debsums, processes, and broken-symlinks check after the first purge
       in --install-purge-install mode.
     - Add --install-recommends option, disabled by default.
+    - Mark temporary directories with a .piuparts.tmpdir file.
   * piuparts.conf:
     - New per section settings: expire-old-days, expire-fail-days (defaulting
       to 0 which means expiration is disabled).
diff --git a/piuparts.py b/piuparts.py
index ee41bde..607d23e 100644
--- a/piuparts.py
+++ b/piuparts.py
@@ -509,6 +509,7 @@ def make_metapackage(name, depends, conflicts):
 
     tmpdir = tempfile.mkdtemp(dir=settings.tmpdir)
     panic_handler_id = do_on_panic(lambda: shutil.rmtree(tmpdir))
+    create_file(os.path.join(tmpdir, ".piuparts.tmpdir"), "metapackage creation")
     old_umask = os.umask(0)
     os.makedirs(os.path.join(tmpdir, name, 'DEBIAN'), mode = 0755)
     os.umask(old_umask)
@@ -747,6 +748,7 @@ class Chroot:
     def create_temp_dir(self):
         """Create a temporary directory for the chroot."""
         self.name = tempfile.mkdtemp(dir=settings.tmpdir)
+        create_file(os.path.join(self.name, ".piuparts.tmpdir"), "chroot")
         os.chmod(self.name, 0755)
         logging.debug("Created temporary directory %s" % self.name)
 
@@ -813,6 +815,8 @@ class Chroot:
                 run(['schroot', '--end-session', '--chroot', "session:" + self.schroot_session])
             if not settings.schroot:
                 shutil.rmtree(self.name)
+                if os.path.exists(self.name):
+                    create_file(os.path.join(self.name, ".piuparts.tmpdir"), "removal failed")
                 logging.debug("Removed directory tree at %s" % self.name)
         elif settings.keep_tmpdir:
             if settings.schroot:

-- 
piuparts git repository



More information about the Piuparts-commits mailing list