[Treepkg-commits] r281 - branches/scratchbox/treepkg

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 16 10:29:31 CEST 2010


Author: bricks
Date: 2010-04-16 10:29:31 +0200 (Fri, 16 Apr 2010)
New Revision: 281

Modified:
   branches/scratchbox/treepkg/sbuilder.py
Log:
ensure builderconfig exists
command for building packages with sbdmock is gerated


Modified: branches/scratchbox/treepkg/sbuilder.py
===================================================================
--- branches/scratchbox/treepkg/sbuilder.py	2010-04-16 08:26:49 UTC (rev 280)
+++ branches/scratchbox/treepkg/sbuilder.py	2010-04-16 08:29:31 UTC (rev 281)
@@ -38,6 +38,8 @@
         commands with several shell-words can be used without having to
         worry about quoting.
         """
+        if not os.path.exists(builderconfig):
+            raise RuntimeError("Config file %s for sbdmock does not exist.")
         self.builderconfig = builderconfig
         self.root_cmd = root_cmd
         self.release_signing_keyid = release_signing_keyid
@@ -97,22 +99,26 @@
         """
         args = []
         if logfile is not None:
-            args.extend(["--logfile", logfile])
+	    logdir = os.path.dirname(logfile)
+            args.extend(["--buildlog=", logfile])
+            args.extend(["--logdir=", logdir])
         if binary_dir is not None:
-            args.extend(["--buildresult", binary_dir])
+            args.extend(["--resultdir=", binary_dir])
             util.ensure_directory(binary_dir)
-        for mount in bindmounts:
-            args.extend(["--bindmounts", mount])
-        for pkg in extra_packages:
-            args.extend(["--extrapackages", pkg])
-        logging.debug(" here we should run sbdmock ...")
-#        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)
+#        for mount in bindmounts:
+#            args.extend(["--bindmounts", mount])
+#        for pkg in extra_packages:
+#            args.extend(["--extrapackages", pkg])
+        logging.debug("Starting build process with sbdmock ...")
+
+        cmd = cmdexpand("/usr/bin/sbdmock --cleanbuilddir"
+                           " --config=$builderconfig"
+#                           " --dbo=" # aren't debian build options setable in treepkg.cfg?
+                           " -u -b $dsc @args",
+                           builderconfig=self.builderconfig,
+                           dsc=dsc_file, args=args)
+        logging.debug("sbdmock cmd: %s" % cmd)
+#         run.call(cmdexpand, 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



More information about the Treepkg-commits mailing list