[Piuparts-commits] rev 175 - in trunk: . debian

Filippo Giunchedi filippo at alioth.debian.org
Sat Nov 29 15:23:45 UTC 2008


Author: filippo
Date: 2008-11-29 15:23:45 +0000 (Sat, 29 Nov 2008)
New Revision: 175

Modified:
   trunk/debian/changelog
   trunk/piuparts.py
Log:
Check for any output when running cron files in addition to exit code

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2008-11-29 00:42:08 UTC (rev 174)
+++ trunk/debian/changelog	2008-11-29 15:23:45 UTC (rev 175)
@@ -1,10 +1,14 @@
 piuparts (0.34) UNRELEASED; urgency=low
 
+  [ Holger Levsen ]
   * Mount /selinux on systems where selinux is enabled. Thanks to Filippo
     Giunchedi for the patch! (CLoses: 507171)
 
- -- Holger Levsen <holger at debian.org>  Sat, 29 Nov 2008 01:40:28 +0100
+  [ Filippo Giunchedi ]
+  * Check for any output when running cron files in addition to exit code
 
+ -- Filippo Giunchedi <filippo at debian.org>  Sat, 29 Nov 2008 16:06:55 +0100
+
 piuparts (0.33) unstable; urgency=low
 
   * Added --bindmount option, thanks to Aníbal Monsalve Salaza for the patch. 

Modified: trunk/piuparts.py
===================================================================
--- trunk/piuparts.py	2008-11-29 00:42:08 UTC (rev 174)
+++ trunk/piuparts.py	2008-11-29 15:23:45 UTC (rev 175)
@@ -944,6 +944,7 @@
                     if os.path.isfile(self.relative(pathname.strip("/"))):
                         st = os.lstat(self.relative(pathname.strip("/")))
                         mode = st[stat.ST_MODE]
+                        # XXX /etc/cron.d/ files are NOT executables
                         if (mode & stat.S_IEXEC): 
                             if not has_cronfiles:
                                 has_cronfiles = True
@@ -956,13 +957,20 @@
     def check_output_cronfiles (self, list):
         """Check if a given list of cronfiles has any output. Executes 
 	cron file as cron would do (except for SHELL)"""
+        failed = False
         for file in list:
 
             if not os.path.exists(self.relative(file.strip("/"))):
                 continue 
 
-            self.run([file])
+            (retval, output) = self.run([file])
+            if output:
+                failed = True
+                logging.error("Cron file %s has output with package removed" % file)
 
+        if failed:
+            panic()
+
     def run_scripts (self, step):
         """ Run custom scripts to given step post-install|remove|purge"""
 




More information about the Piuparts-commits mailing list