summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Jardón <jjardon@gnome.org>2017-01-21 12:13:40 +0000
committerBen Brown <ben.brown@codethink.co.uk>2018-08-06 14:08:52 +0000
commit21faf5b5d0cebfb50d59c52b78abc1805ccd87fe (patch)
tree6af193335ab65e75a129ea69b39d6980e7d119e1
parent94ed3c2f4145d4b1c3a21b4f23dda70166280370 (diff)
downloadybd-jjardon/error_in_missing_refs.tar.gz
Add new configuration parameter: 'check-references'jjardon/error_in_missing_refs
I think missing references to .morph files are way more important that incorrect names or other defects in definitions. I'd like to make ybd to exit when this happen, but lets add a new configuration parameter ans set it to 'warn' instead 'exit' to keep compatibility with older (probably broken) definitions
-rw-r--r--ybd/config/ybd.conf6
-rw-r--r--ybd/morphs.py4
2 files changed, 9 insertions, 1 deletions
diff --git a/ybd/config/ybd.conf b/ybd/config/ybd.conf
index 129e1bd..79aea84 100644
--- a/ybd/config/ybd.conf
+++ b/ybd/config/ybd.conf
@@ -74,6 +74,12 @@ artifact-version: 13
# path to be used in default chroots for builds
base-path: ['/usr/bin', '/bin', '/usr/sbin', '/sbin']
+# This set how ybd should react to missing references to .morph files
+# Default value is 'warn' to not break previous definitions,
+# but we recommend set this it to 'exit'
+# possible values are 'ignore', 'warn', 'exit'
+check-references: 'warn'
+
# historically we have not been great at ensuring definitions don't contain
# wrong names etc. ybd can react to this via the check-definitions parameter.
# possible values are 'ignore', 'warn', 'exit'
diff --git a/ybd/morphs.py b/ybd/morphs.py
index 4e1059d..3d04dd2 100644
--- a/ybd/morphs.py
+++ b/ybd/morphs.py
@@ -146,10 +146,12 @@ class Morphs(object):
'''
exit = (config.get('check-definitions') == 'exit')
+ exit_ref = (config.get('check-references') == 'exit')
if dn.get('morph'):
if not os.path.isfile(dn.get('morph')):
- log('DEFINITION', 'WARNING: missing', dn['morph'], exit=exit)
+ log('DEFINITION', 'WARNING: missing', dn['morph'],
+ exit=exit_ref)
dn['path'] = self._demorph(dn.pop('morph'))
if 'path' not in dn: