Commit 7c7e5861 authored by locallycompact-ct's avatar locallycompact-ct

Use defslib version of DEFAULTS

parent ea451468
......@@ -28,7 +28,6 @@ from ybd.deployment import deploy
from ybd.concourse import Pipeline
from ybd.release_note import do_release_note
from defslib import MorphologyResolver, Actuator
from ybd.defaults import Defaults
import sandboxlib
import yaml
......@@ -62,7 +61,6 @@ with timer('TOTAL'):
with timer('DEFINITIONS', 'parsing %s' % config['def-version']):
m = MorphologyResolver(config['defdir'])
app.defs = m
app.defaults = Defaults()
target = m.lookup(config['target'])
if config.get('mode', 'normal') == 'parse-only':
......
......@@ -158,7 +158,7 @@ def run_build(dn, supports):
env_vars = sandbox.env_vars_for_build(dn, supports)
log(dn, 'Logging build commands to %s' % dn['log'])
for build_step in app.defaults.build_steps:
for build_step in app.defs.defaults['build-steps']:
if dn.get(build_step):
log(dn, 'Running', build_step)
for command in dn.get(build_step, []):
......@@ -227,9 +227,9 @@ def get_build_commands(dn):
exit = True if config.get('check-definitions') == 'exit' else False
for build_step in app.defs.defaults.build_steps:
for build_step in app.defs.defaults['build-steps']:
if dn.get(build_step, None) is None:
commands = app.defs.defaults.build_systems[bs].get(build_step, [])
commands = app.defs.defaults['build-systems'][bs].get(build_step, [])
dn[build_step] = commands
......
......@@ -93,7 +93,7 @@ def hash_factors(dn):
key = list(factor.keys())[0]
hash_factors[key] = cache_key(key)
relevant_factors = ['tree', 'submodules'] + app.defs.defaults.build_steps
relevant_factors = ['tree', 'submodules'] + app.defs.defaults['build-steps']
if app.config.get('artifact-version', False) not in range(0, 6):
relevant_factors += ['devices']
......@@ -121,12 +121,12 @@ def hash_factors(dn):
if app.config.get('artifact-version', 0) in range(0, 2):
# this way, any change to any build-system invalidates all caches
hash_factors['default-build-systems'] = \
app.defs.defaults.build_systems
app.defs.defaults['build-systems']
else:
# this way is better - only affected components get a new key
hash_factors['default-build-systems'] = \
app.defs.defaults.build_systems.get(dn.get('build-system',
'manual'))
app.defs.defaults['build-systems'].get(dn.get('build-system',
'manual'))
if (app.config.get('default-splits', []) != [] and
dn.get('kind') == 'system'):
hash_factors['default-splits'] = app.config['default-splits']
......
......@@ -306,7 +306,7 @@ def env_vars_for_build(dn, dependencies):
env['TZ'] = 'UTC'
arch = app.config['arch']
cpu = app.defaults.cpus.get(arch, arch)
cpu = app.defs.defaults['cpus'].get(arch, arch)
abi = ''
if arch.startswith(('armv7', 'armv5')):
abi = 'eabi'
......
......@@ -32,7 +32,7 @@ def install_split_artifacts(dn):
'''
all_splits = []
for i in app.defs.defaults.get_split_rules('stratum'):
for i in app.defs.defaults['split-rules']['assemblage']:
all_splits += [i['artifact']]
for index, content in enumerate(dn['contents']):
for stratum, artifacts in content.items():
......@@ -165,7 +165,7 @@ def compile_rules(dn):
regexps = []
splits = {}
split_rules = dn.get('products', [])
default_rules = app.defaults.get_split_rules(dn.get('kind', 'chunk'))
default_rules = app.defs.defaults['split-rules'][dn.get('kind', 'chunk')]
for rules in split_rules, default_rules:
for rule in rules:
regexp = re.compile('^(?:' + '|'.join(rule.get('include')) + ')$')
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment