changeset 336:5fa56edeb606

Changed the Build Logs to be gziped before they are published
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 13 Apr 2010 09:29:08 +0000
parents 85eb9425c346
children 781074885633
files bin/updatetreepkg.py notification-template.txt treepkg/builder.py treepkg/packager.py
diffstat 4 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/bin/updatetreepkg.py	Thu Apr 08 10:18:49 2010 +0000
+++ b/bin/updatetreepkg.py	Tue Apr 13 09:29:08 2010 +0000
@@ -60,11 +60,11 @@
             # Originally, the build logs were called build.log and were
             # in the base directory of a revision
             rename_file(os.path.join(revision.base_dir, "build.log"),
-                        revision.build_log, dry_run)
+                        revision.get_build_log(), dry_run)
             # for a while, the build logs were called build_log.txt but
             # still were in the base directory
             rename_file(os.path.join(revision.base_dir, "build_log.txt"),
-                        revision.build_log, dry_run)
+                        revision.get_build_log(), dry_run)
         # Revision directories used to end with "-1".  Now that number
         # is the revision of the packaging rules which default to 0 for
         # the traditional manual rules management without a version
--- a/notification-template.txt	Thu Apr 08 10:18:49 2010 +0000
+++ b/notification-template.txt	Tue Apr 13 09:29:08 2010 +0000
@@ -9,7 +9,7 @@
 an error occurred while building the %(track)s packages for revision
 %(revision)s.  Details are available in the build log:
 
-  http://example.com/treepkg/%(track)s/%(revision)s-%(rules_revision)s/build_log.txt
+  http://example.com/treepkg/%(track)s/%(revision)s-%(rules_revision)s/build_log.txt.gz
 
 General information about the status of the packages is available at
 
--- a/treepkg/builder.py	Thu Apr 08 10:18:49 2010 +0000
+++ b/treepkg/builder.py	Tue Apr 13 09:29:08 2010 +0000
@@ -186,6 +186,8 @@
                            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))
         # remove the source package files put into the binary directory
         # by pbuilder
         if binary_dir is not None:
--- a/treepkg/packager.py	Thu Apr 08 10:18:49 2010 +0000
+++ b/treepkg/packager.py	Tue Apr 13 09:29:08 2010 +0000
@@ -275,7 +275,12 @@
         return None
 
     def has_build_log(self):
-        return os.path.exists(self.build_log)
+        return os.path.exists(self.get_log_file())
+
+    def get_log_file(self):
+        if os.path.exists(self.build_log + ".gz"):
+            return self.build_log + ".gz"
+        return self.build_log
 
     def list_log_files(self):
         """Returns a list describing the logfiles available for the revision.
@@ -285,7 +290,7 @@
         """
         files = []
         if self.has_build_log():
-            files.append(("build log", self.build_log))
+            files.append(("build log", self.get_log_file()))
         return files
 
     def list_source_files(self):
@@ -313,8 +318,7 @@
             if dsc_file is None:
                 raise RuntimeError("Cannot find dsc File in %r" % self.src_dir)
 
-            bin_packager = self.binary_packager_cls(self, dsc_file,
-                                                    self.build_log)
+            bin_packager = self.binary_packager_cls(self, dsc_file, self.build_log)
             bin_packager.package()
             self.status.stop = datetime.datetime.utcnow()
         except:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)