[Treepkg-commits] r422 - trunk/treepkg
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Aug 31 17:56:49 CEST 2010
Author: aheinecke
Date: 2010-08-31 17:56:46 +0200 (Tue, 31 Aug 2010)
New Revision: 422
Modified:
trunk/treepkg/builder.py
trunk/treepkg/packager.py
trunk/treepkg/sbuilder.py
trunk/treepkg/util.py
Log:
Make the compress_all_logs call builder independent and also compress
if an error occurs before the builders are executed.
Modified: trunk/treepkg/builder.py
===================================================================
--- trunk/treepkg/builder.py 2010-08-30 13:32:31 UTC (rev 421)
+++ trunk/treepkg/builder.py 2010-08-31 15:56:46 UTC (rev 422)
@@ -206,20 +206,14 @@
args.extend(["--bindmounts", mount])
for pkg in extra_packages:
args.extend(["--extrapackages", pkg])
- 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:
- util.compress_all_logs(logfile)
- raise
+ 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)
- util.compress_all_logs(logfile)
-
# remove the source package files put into the binary directory
# by pbuilder
if binary_dir is not None:
Modified: trunk/treepkg/packager.py
===================================================================
--- trunk/treepkg/packager.py 2010-08-30 13:32:31 UTC (rev 421)
+++ trunk/treepkg/packager.py 2010-08-31 15:56:46 UTC (rev 422)
@@ -372,18 +372,21 @@
def package(self):
try:
- util.ensure_directory(self.work_dir)
- self.status.start = datetime.datetime.utcnow()
- src_packager = self.source_packager_cls(self)
- src_packager.package()
+ try:
+ util.ensure_directory(self.work_dir)
+ self.status.start = datetime.datetime.utcnow()
+ src_packager = self.source_packager_cls(self)
+ src_packager.package()
- dsc_file = self.find_dsc_file()
- if dsc_file is None:
- raise RuntimeError("Cannot find dsc File in %r" % self.src_dir)
+ dsc_file = self.find_dsc_file()
+ 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.package()
- self.status.stop = datetime.datetime.utcnow()
+ bin_packager = self.binary_packager_cls(self, dsc_file, self.build_log)
+ bin_packager.package()
+ self.status.stop = datetime.datetime.utcnow()
+ finally:
+ util.compress_all_logs(self.log_dir)
except:
self.status.error()
self.status.stop = datetime.datetime.utcnow()
Modified: trunk/treepkg/sbuilder.py
===================================================================
--- trunk/treepkg/sbuilder.py 2010-08-30 13:32:31 UTC (rev 421)
+++ trunk/treepkg/sbuilder.py 2010-08-31 15:56:46 UTC (rev 422)
@@ -139,8 +139,6 @@
if os.path.splitext(filename)[1] not in (".deb", ".changes"):
os.remove(os.path.join(binary_dir, filename))
finally:
- # compress logfiles
- util.compress_all_logs(logfile)
# remove all mounted directories
self.umount_all()
Modified: trunk/treepkg/util.py
===================================================================
--- trunk/treepkg/util.py 2010-08-30 13:32:31 UTC (rev 421)
+++ trunk/treepkg/util.py 2010-08-31 15:56:46 UTC (rev 422)
@@ -196,8 +196,9 @@
files in same folder with the cmd command.
"""
if reference_log and os.path.exists(reference_log):
- log_dir = os.path.dirname(reference_log)
- for log_file in [os.path.join(log_dir, f)
+ log_dir = os.path.isdir(reference_log) and \
+ reference_log or os.path.dirname(reference_log)
+ for log_file in [os.path.join(log_dir, f)
for f in os.listdir(log_dir)]:
if os.path.isfile(log_file):
run.call(cmdexpand(cmd, logfile=log_file))
More information about the Treepkg-commits
mailing list