diff treepkg/packager.py @ 112:cea98d4e4a6a

Abstract the pbuilder calls into the new class treepkg.builder.PBuilder. Use this class in treepkg.packager.
author Bernhard Herzog <bh@intevation.de>
date Thu, 20 Mar 2008 20:21:34 +0000
parents 66cbfc772f84
children 312949e7628d
line wrap: on
line diff
--- a/treepkg/packager.py	Wed Mar 19 19:50:32 2008 +0000
+++ b/treepkg/packager.py	Thu Mar 20 20:21:34 2008 +0000
@@ -19,6 +19,7 @@
 import run
 import status
 from cmdexpand import cmdexpand
+from builder import PBuilder
 
 def _filenameproperty(relative_dir):
     def get(self):
@@ -187,19 +188,7 @@
         self.status.creating_binary_package()
         util.ensure_directory(self.binary_dir)
         logging.info("Building binary package; logging to %r", self.logfile)
-        run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder build"
-                           " --configfile $pbuilderrc"
-                           " --logfile $logfile --buildresult $bindir $dsc",
-                           rootcmd=self.track.root_cmd,
-                           pbuilderrc=self.track.pbuilderrc,
-                           logfile=self.logfile, bindir=self.binary_dir,
-                           dsc=self.dsc_file),
-                 suppress_output=True)
-        # remove the source package files put into the binary directory
-        # by pbuilder
-        for filename in os.listdir(self.binary_dir):
-            if os.path.splitext(filename)[1] not in (".deb", ".changes"):
-                os.remove(os.path.join(self.binary_dir, filename))
+        self.track.builder.build(self.dsc_file, self.binary_dir, self.logfile)
         self.status.binary_package_created()
 
 
@@ -291,8 +280,7 @@
         self.name = name
         self.base_dir = base_dir
         self.svn_url = svn_url
-        self.root_cmd = root_cmd
-        self.pbuilderrc = pbuilderrc
+        self.builder = PBuilder(pbuilderrc, root_cmd)
         self.deb_email = deb_email
         self.deb_fullname = deb_fullname
         self.debrevision_prefix = debrevision_prefix
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)