Create all necessary paths automatically
authorRalf Jung <post@ralfj.de>
Fri, 27 Jul 2012 12:17:01 +0000 (14:17 +0200)
committerRalf Jung <ralfjung-e@gmx.de>
Fri, 27 Jul 2012 12:17:01 +0000 (14:17 +0200)
auto_debuild.py

index 9d7c0421d850ac8537dfd082f004c5d96a4ae2e8..eda72e3a5f366b478077c42a1b07907f8ad87933 100755 (executable)
@@ -77,8 +77,11 @@ def createDebianFiles(config):
        # we return the list of files generated, so we need to know the architecture
        arch = getArchitecture(config)
        files = []
-       # source format file
+       # create folders
+       if not os.path.exists('debian'): os.mkdir('debian')
        if not os.path.exists('debian/source'): os.mkdir('debian/source')
+       if not os.path.exists(debDir): os.mkdir(debDir)
+       # source format file
        with open('debian/source/format', 'w') as f:
                print >>f, "3.0 (native)"
        # compat file
@@ -149,7 +152,7 @@ def createDebianFiles(config):
 
 def buildDebianPackage(config):
        commands = ['dpkg-checkbuilddeps', 'debian/rules clean', 'debian/rules build', 'fakeroot debian/rules binary', 'debian/rules clean']
-       command = ['bash', '-c', ' && '.join(commands)]
+       command = ['nice', 'bash', '-c', ' && '.join(commands)]
        subprocess.check_call(commandInBuildEnv(config, command))
 
 # all at once