# HG changeset patch # User Andre Heinecke # Date 1271150948 0 # Node ID 5fa56edeb606624f7cac9e851779adc76461bb5a # Parent 85eb9425c346c65c780c1073df3d331d08792f3e Changed the Build Logs to be gziped before they are published diff -r 85eb9425c346 -r 5fa56edeb606 bin/updatetreepkg.py --- 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 diff -r 85eb9425c346 -r 5fa56edeb606 notification-template.txt --- 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 diff -r 85eb9425c346 -r 5fa56edeb606 treepkg/builder.py --- 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: diff -r 85eb9425c346 -r 5fa56edeb606 treepkg/packager.py --- 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: