Pass parallel job count to auto-debuild
[mass-build.git] / build_system.py
index d74689ffd734fb82f3e220adbfda1c9d8b208c3e..8ebf6f34aa215149f222b3302d106813f3c6b330 100644 (file)
@@ -50,19 +50,24 @@ try:
                                'name': config['debName'],
                                'email': config['debEMail'],
                        }
-                       self.copyFromModule(module, 'buildDepends')
-                       self.copyFromModule(module, 'binaryDepends')
-                       if buildSystem == 'cmakeParameters':
-                               self.copyFromModule(module, 'cmakeParameters')
+                       self.copyOption(config, 'jobs', 'parallelJobs')
+                       self.copyOption(module, 'dbgPackage')
+                       self.copyOption(module, 'buildDepends')
+                       self.copyOption(module, 'binaryDepends')
+                       if buildSystem == 'cmake':
+                               self.copyOption(module, 'cmakeParameters')
                        self.vcs = vcs
                        self.configured = False # make sure configure is called before build/install
 
-               def copyFromModule(self, module, name):
-                       if name in module:
-                               self.autoDebuildConfig[name] = module[name]
+               def copyOption(self, src, name, dstName = None):
+                       if dstName is None: dstName = name # per default, stick with original name
+                       if name in src:
+                               self.autoDebuildConfig[dstName] = src[name]
 
                def configure(self, force=False): # force is ignored
                        self.autoDebuildConfig['version'] = self.vcs.version() # by now, data has been fetched, so this is possible
+                       if self.autoDebuildConfig['version'] is None:
+                               raise Exception("VCS did not provide us with a proper version, please fix this")
                        self.vcs.ignore('/debian/') # make sure the debian folder is ignored
                        os.chdir(self.sourceFolder)
                        #print self.autoDebuildConfig