we have to disable dh_usrlocal
[auto-debuild.git] / auto_debuild.py
index 208010984fcc4da949235725420e0f2609598595..a964b657695a54a49ce798d6cffaee824d8cc8cc 100755 (executable)
@@ -103,8 +103,6 @@ class RulesFile:
        def write(self, f):
                print("#!/usr/bin/make -f", file=f)
                print(file=f)
        def write(self, f):
                print("#!/usr/bin/make -f", file=f)
                print(file=f)
-               print(".PHONY: build", file=f) # there may be a directory called "build"
-               print(file=f)
                print("%:", file=f)
                # write proper dh call
                dh = self.dh
                print("%:", file=f)
                # write proper dh call
                dh = self.dh
@@ -207,7 +205,7 @@ def createDebianFiles(config):
        buildSystem = buildSystems[config.getstr('buildSystem')] # get the data immediately
        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
        buildSystem = buildSystems[config.getstr('buildSystem')] # get the data immediately
        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
-       parallelJobs = config.getint('parallelJobs', multiprocessing.cpu_count()+1)
+       parallelJobs = config.getint('parallelJobs', multiprocessing.cpu_count())
        packageArchitecture = config.getstr('architecture', 'any')
        withPython2 = config.getbool('withPython2', False)
        withSIP = config.getbool('withSIP', False)
        packageArchitecture = config.getstr('architecture', 'any')
        withPython2 = config.getbool('withPython2', False)
        withSIP = config.getbool('withSIP', False)
@@ -327,6 +325,7 @@ def createDebianFiles(config):
                r.rules['auto_test'] = []
                r.rules['auto_install'] = [safeCall('dh_auto_install', '--destdir=debian/'+binaryName)] # install everything into the binary package
                r.rules['auto_configure'] = ['dh_auto_configure'] # make sure there is an override (we may just append to it later)
                r.rules['auto_test'] = []
                r.rules['auto_install'] = [safeCall('dh_auto_install', '--destdir=debian/'+binaryName)] # install everything into the binary package
                r.rules['auto_configure'] = ['dh_auto_configure'] # make sure there is an override (we may just append to it later)
+               r.rules['usrlocal'] = [] # we *do* want to install things in /usr/local
                # patch rule file for build system: may only touch auto_* rules and the dh options
                buildSystem.ruleMaker(r, config)
                # global rules
                # patch rule file for build system: may only touch auto_* rules and the dh options
                buildSystem.ruleMaker(r, config)
                # global rules
@@ -383,10 +382,10 @@ if __name__ == "__main__":
                        deleteDebianFolder()
                files = createDebianFiles(config)
                # check if a file is overwritten
                        deleteDebianFolder()
                files = createDebianFiles(config)
                # check if a file is overwritten
-               for file in files:
-                       if os.path.exists(file):
-                               if input("Do you want to overwrite %s (y/N)? " % file).lower() != "y":
-                                       sys.exit(1)
+               overwritten_files = list(filter(lambda file: os.path.exists(file), files))
+               if overwritten_files:
+                       if input("Do you want to overwrite {} (y/N)? ".format(', '.join(overwritten_files))).lower() != "y":
+                               sys.exit(1)
                # run compilation
                buildDebianPackage(config)
                # install files
                # run compilation
                buildDebianPackage(config)
                # install files