diff treepkg/packager.py @ 45:3e610233ccfe

use cmdexpand when calling subprocesses
author Bernhard Herzog <bh@intevation.de>
date Tue, 20 Mar 2007 17:27:46 +0100
parents f7ec40638a06
children e1028211d34b
line wrap: on
line diff
--- a/treepkg/packager.py	Mon Mar 19 20:14:07 2007 +0100
+++ b/treepkg/packager.py	Tue Mar 20 17:27:46 2007 +0100
@@ -19,7 +19,7 @@
 import subversion
 import run
 import status
-
+from cmdexpand import cmdexpand
 
 def _filenameproperty(relative_dir):
     def get(self):
@@ -94,7 +94,8 @@
                      filename directly in workdir.
         """
         logging.info("Creating tarball %r", tarballname)
-        run.call(["tar", "czf", tarballname, "-C", workdir, basedir])
+        run.call(cmdexpand("tar czf $tarballname -C $workdir $basedir",
+                           **locals()))
 
     def copy_debian_directory(self, pkgbasedir, pkgbaseversion, changemsg):
         """Copies the debian directory and updates the copy's changelog
@@ -121,17 +122,18 @@
             oldversionprefix = oldversion.split(":")[0] + ":"
         else:
             oldversionprefix = ""
-        run.call(["debchange", "-c", changelog,
-                  "-v", oldversionprefix + pkgbaseversion + "-kk1",
-                  changemsg],
+        run.call(cmdexpand("debchange -c  $changelog"
+                           " -v ${oldversionprefix}${pkgbaseversion}-kk1"
+                           " $changemsg", **locals()),
                  env=self.pkg_line.debian_environment())
 
 
     def create_source_package(self, pkgbasedir, origtargz):
         """Creates a new source package from pkgbasedir and origtargz"""
         logging.info("Creating new source package")
-        run.call(["dpkg-source", "-b", os.path.basename(pkgbasedir),
-                  os.path.basename(origtargz)],
+        run.call(cmdexpand("dpkg-source -b $directory $tarball",
+                           directory=os.path.basename(pkgbasedir),
+                           tarball=os.path.basename(origtargz)),
                  cwd=os.path.dirname(pkgbasedir),
                  suppress_output=True,
                  env=self.pkg_line.debian_environment())
@@ -185,9 +187,11 @@
         self.status.creating_binary_package()
         util.ensure_directory(self.binary_dir)
         logging.info("Building binary package; loging to %r", self.logfile)
-        cmd = ["/usr/sbin/pbuilder", "build", "--logfile", self.logfile,
-               "--buildresult", self.binary_dir, self.dsc_file]
-        run.call(self.pkg_line.root_cmd + cmd, suppress_output=True)
+        run.call(cmdexpand("@rootcmd /usr/sbin/pbuilder build"
+                           " --logfile $logfile --buildresult $bindir $dsc",
+                           rootcmd=self.pkg_line.root_cmd, logfile=self.logfile,
+                           bindir=self.binary_dir, dsc=self.dsc_file),
+                 suppress_output=True)
         self.status.binary_package_created()
 
 
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)