chiark / gitweb /
Fixes to config parsers
authorDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Dec 2013 15:38:46 +0000 (16:38 +0100)
committerDaniel Martí <mvdan@mvdan.cc>
Fri, 6 Dec 2013 15:38:46 +0000 (16:38 +0100)
fdroidserver/common.py
makebuildserver.py

index 73c0730e5321f87c02f82d08118772f9bd8de0db..7970897151145b825813323fb3d991442262ffb8 100644 (file)
@@ -55,7 +55,7 @@ def read_config(opts, config_file='config.py'):
     if not hasattr(options, 'verbose'):
         options.verbose = False
 
-    config = {
+    defconfig = {
         'build_server_always': False,
         'mvn3': "mvn3",
         'archive_older': 0,
@@ -66,6 +66,8 @@ def read_config(opts, config_file='config.py'):
         'stats_to_carbon': False,
         'repo_maxage': 0
     }
+    config = {}
+
     if options.verbose:
         print "Reading %s..." % config_file
     execfile(config_file, config)
@@ -98,6 +100,10 @@ def read_config(opts, config_file='config.py'):
             print "ERROR: No such directory found for %s: %s" % (key, val)
             sys.exit(3)
 
+    for k, v in defconfig.items():
+        if k not in config:
+            config[k] = v
+
     return config
 
 def getapkname(app, build):
index f0582754da2c338c1665ed5b1c89da59a4301c5f..3ccf239a56aaf100d773d7b43989f00a59eb1ec3 100755 (executable)
@@ -5,7 +5,6 @@ import sys
 import subprocess
 import time
 from optparse import OptionParser
-from fdroidserver import common
 
 def vagrant(params, cwd=None, printout=False):
     """Run vagrant.
@@ -42,7 +41,8 @@ parser.add_option("-c", "--clean", action="store_true", default=False,
                       help="Build from scratch, rather than attempting to update the existing server")
 options, args = parser.parse_args()
 
-config = common.read_config(options, 'makebs.config.py')
+config = {}
+execfile('makebs.config.py', config)
 
 if not os.path.exists('makebuildserver.py') or not os.path.exists(serverdir):
     print 'This must be run from the correct directory!'