X-Git-Url: https://git.ralfj.de/auto-debuild.git/blobdiff_plain/f10524d6b291b01312cd5d00df1f147844612dd5..49195767675bb04a0b42877452049b56a8369820:/auto_debuild.py diff --git a/auto_debuild.py b/auto_debuild.py index bee82ca..a5fb5bc 100755 --- a/auto_debuild.py +++ b/auto_debuild.py @@ -16,7 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -import os, shutil, stat, time, subprocess, sys, shlex, tempfile, argparse +import os, shutil, stat, time, subprocess, sys, shlex, tempfile, argparse, multiprocessing from collections import OrderedDict # a dict with some useful additional getters which can convert types and handle one-element lists like their single member @@ -180,7 +180,7 @@ def getArchitecture(config): with subprocess.Popen(cmd, stdout=subprocess.PIPE) as p: res = p.communicate()[0] # get only stdout if p.returncode != 0: raise Exception("Querying dpkg for the architecture failed") - return res[0:len(res)-1] # chop of the \n at the end + return res.decode('utf-8').strip('\n') # chop of the \n at the end def writeDependency(f, name, list): if len(list): @@ -209,7 +209,7 @@ def createDebianFiles(config): version = config.getstr('version') # version name excluding epoch (used for filenames) fullVersion = str(config.getint('epoch'))+':'+version if 'epoch' in config else version # version name including epoch dbgPackage = config.getbool('dbgPackage', False) - parallelJobs = config.getint('parallelJobs', 2) + parallelJobs = config.getint('parallelJobs', multiprocessing.cpu_count()+1) packageArchitecture = config.getstr('architecture', 'any') withPython2 = config.getbool('withPython2', False) withSIP = config.getbool('withSIP', False)