Implemented better option checking and defaults for builds.
This commit is contained in:
parent
8c4bc65184
commit
03fc28a1bf
|
@ -136,17 +136,21 @@ def batch(yamlfile, verbose):
|
||||||
|
|
||||||
# Globals for yamlfile
|
# Globals for yamlfile
|
||||||
gvars = {}
|
gvars = {}
|
||||||
gvars['storage_path'] = "/srv/http/appimage.sys42.eu"
|
|
||||||
if 'repo' in config['data'] and config['data']['repo']:
|
|
||||||
gvars['storage_path'] = config['data']['repo']
|
|
||||||
|
|
||||||
gvars['download_path'] = "/var/tmp/downloads"
|
gvars['download_path'] = "/var/tmp/downloads"
|
||||||
if 'download' in config['data'] and config['data']['download']:
|
if 'download' in config['data'] and config['data']['download']:
|
||||||
gvars['download_path'] = config['data']['download']
|
gvars['download_path'] = config['data']['download']
|
||||||
|
|
||||||
|
gvars['force'] = False
|
||||||
|
if 'force' in config['data'] and config['data']['force']:
|
||||||
|
gvars['force'] = config['data']['force']
|
||||||
|
|
||||||
|
gvars['storage_path'] = "/srv/http/appimage"
|
||||||
|
if 'repo' in config['data'] and config['data']['repo']:
|
||||||
|
gvars['storage_path'] = config['data']['repo']
|
||||||
|
|
||||||
gvars['remoterepo'] = False
|
gvars['remoterepo'] = False
|
||||||
gvars['remote_host'] = ''
|
gvars['remote_host'] = ''
|
||||||
gvars['remote_path'] = "/var/lib/nethserver/vhost/appimages"
|
gvars['remote_path'] = "/srv/http/appimage"
|
||||||
if 'http' in gvars['storage_path']:
|
if 'http' in gvars['storage_path']:
|
||||||
gvars['remoterepo'] = True
|
gvars['remoterepo'] = True
|
||||||
gvars['remote_host'] = "ciccio.libreitalia.org"
|
gvars['remote_host'] = "ciccio.libreitalia.org"
|
||||||
|
@ -156,6 +160,7 @@ def batch(yamlfile, verbose):
|
||||||
if 'remote_path' in config['data'] and config['data']['remote_path']:
|
if 'remote_path' in config['data'] and config['data']['remote_path']:
|
||||||
gvars['remote_path'] = config['data']['remote_path']
|
gvars['remote_path'] = config['data']['remote_path']
|
||||||
|
|
||||||
|
gvars['sign'] = False
|
||||||
if 'sign' in config['data'] and config['data']['sign']:
|
if 'sign' in config['data'] and config['data']['sign']:
|
||||||
gvars['sign'] = True
|
gvars['sign'] = True
|
||||||
|
|
||||||
|
@ -168,9 +173,15 @@ def batch(yamlfile, verbose):
|
||||||
for obj in collection:
|
for obj in collection:
|
||||||
# Configuration phase
|
# Configuration phase
|
||||||
obj.verbose = verbose
|
obj.verbose = verbose
|
||||||
obj.language = cbuild['language']
|
obj.language = 'basic'
|
||||||
obj.offline_help = cbuild['offline_help']
|
if 'language' in cbuild and cbuild['language']:
|
||||||
obj.portable = cbuild['portable']
|
obj.language = cbuild['language']
|
||||||
|
obj.offline_help = False
|
||||||
|
if 'offline_help' in cbuild and cbuild['offline_help']:
|
||||||
|
obj.offline_help = cbuild['offline_help']
|
||||||
|
obj.portable = False
|
||||||
|
if 'portable' in cbuild and cbuild['portable']:
|
||||||
|
obj.portable = cbuild['portable']
|
||||||
obj.updatable = True
|
obj.updatable = True
|
||||||
obj.storage_path = gvars['storage_path']
|
obj.storage_path = gvars['storage_path']
|
||||||
obj.download_path = gvars['download_path']
|
obj.download_path = gvars['download_path']
|
||||||
|
@ -181,7 +192,8 @@ def batch(yamlfile, verbose):
|
||||||
|
|
||||||
# Build phase
|
# Build phase
|
||||||
obj.calculate()
|
obj.calculate()
|
||||||
obj.check()
|
if not gvars['force']:
|
||||||
|
obj.check()
|
||||||
obj.download()
|
obj.download()
|
||||||
obj.build()
|
obj.build()
|
||||||
obj.checksums()
|
obj.checksums()
|
||||||
|
|
Loading…
Reference in New Issue