changeset 339:524ad62ab207

Build logs are now also compressed when errors occur during building
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 14 Apr 2010 13:17:30 +0000
parents 28df50b267f6
children a83a78a93fd6
files treepkg/builder.py
diffstat 1 files changed, 16 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/treepkg/builder.py	Tue Apr 13 09:53:19 2010 +0000
+++ b/treepkg/builder.py	Wed Apr 14 13:17:30 2010 +0000
@@ -179,15 +179,22 @@
             args.extend(["--bindmounts", mount])
         for pkg in extra_packages:
             args.extend(["--extrapackages", pkg])
-        run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder build"
-                           " --configfile $pbuilderrc @args"
-                           " --debbuildopts -b $dsc",
-                           rootcmd=self.root_cmd, pbuilderrc=self.pbuilderrc,
-                           dsc=dsc_file, args=args),
-                 suppress_output=True,
-                 extra_env=extra_env)
-        if logfile is not None and os.path.exists(logfile):
-            run.call(cmdexpand("gzip -9 $logfile", logfile=logfile))
+        try:
+            run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder build"
+                               " --configfile $pbuilderrc @args"
+                               " --debbuildopts -b $dsc",
+                               rootcmd=self.root_cmd, pbuilderrc=self.pbuilderrc,
+                               dsc=dsc_file, args=args),
+                     suppress_output=True,
+                     extra_env=extra_env)
+        except:
+            if logfile is not None and os.path.exists(logfile):
+                run.call(cmdexpand("gzip -9 $logfile", logfile=logfile))
+            raise
+        else:
+            if logfile is not None and os.path.exists(logfile):
+                run.call(cmdexpand("gzip -9 $logfile", logfile=logfile))
+ 
         # remove the source package files put into the binary directory
         # by pbuilder
         if binary_dir is not None:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)