mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
Fixes to config parsers
This commit is contained in:
parent
9a2a0efa41
commit
3825e5aebe
2 changed files with 9 additions and 3 deletions
|
@ -55,7 +55,7 @@ def read_config(opts, config_file='config.py'):
|
||||||
if not hasattr(options, 'verbose'):
|
if not hasattr(options, 'verbose'):
|
||||||
options.verbose = False
|
options.verbose = False
|
||||||
|
|
||||||
config = {
|
defconfig = {
|
||||||
'build_server_always': False,
|
'build_server_always': False,
|
||||||
'mvn3': "mvn3",
|
'mvn3': "mvn3",
|
||||||
'archive_older': 0,
|
'archive_older': 0,
|
||||||
|
@ -66,6 +66,8 @@ def read_config(opts, config_file='config.py'):
|
||||||
'stats_to_carbon': False,
|
'stats_to_carbon': False,
|
||||||
'repo_maxage': 0
|
'repo_maxage': 0
|
||||||
}
|
}
|
||||||
|
config = {}
|
||||||
|
|
||||||
if options.verbose:
|
if options.verbose:
|
||||||
print "Reading %s..." % config_file
|
print "Reading %s..." % config_file
|
||||||
execfile(config_file, config)
|
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)
|
print "ERROR: No such directory found for %s: %s" % (key, val)
|
||||||
sys.exit(3)
|
sys.exit(3)
|
||||||
|
|
||||||
|
for k, v in defconfig.items():
|
||||||
|
if k not in config:
|
||||||
|
config[k] = v
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|
||||||
def getapkname(app, build):
|
def getapkname(app, build):
|
||||||
|
|
|
@ -5,7 +5,6 @@ import sys
|
||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
from optparse import OptionParser
|
from optparse import OptionParser
|
||||||
from fdroidserver import common
|
|
||||||
|
|
||||||
def vagrant(params, cwd=None, printout=False):
|
def vagrant(params, cwd=None, printout=False):
|
||||||
"""Run vagrant.
|
"""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")
|
help="Build from scratch, rather than attempting to update the existing server")
|
||||||
options, args = parser.parse_args()
|
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):
|
if not os.path.exists('makebuildserver.py') or not os.path.exists(serverdir):
|
||||||
print 'This must be run from the correct directory!'
|
print 'This must be run from the correct directory!'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue