oe-lite / core

Official OE-lite/core repository - moved to GitLab.com
https://gitlab.com/oe-lite/core
Other
4 stars 17 forks source link

class/s6rc: Fix bug when RECIPE_FLAGS is not set #238

Closed esben closed 6 years ago

esben commented 6 years ago

This fixes problems for recipes using s6rc.oeclass without any RECIPE_FLAGS, as we will try to do None.split().

Traceback (most recent call last):
  File "/home/user/manifest/meta/core/lib/oelite/cookbook.py", line 57, in __init__
    if not self.add_recipefile(recipefile):
  File "/home/user/manifest/meta/core/lib/oelite/cookbook.py", line 554, in add_recipefile
    recipe_meta = self.parse_recipe(filename)
  File "/home/user/manifest/meta/core/lib/oelite/cookbook.py", line 683, in parse_recipe
    oelite.pyexec.exechooks(meta[recipe_type], "post_recipe_parse")
  File "/home/user/manifest/meta/core/lib/oelite/pyexec.py", line 44, in exechooks
    retval = hook.run(tmpdir)
  File "/home/user/manifest/meta/core/lib/oelite/function.py", line 37, in run
    self.start(cwd)
  File "/home/user/manifest/meta/core/lib/oelite/function.py", line 52, in start
    self._start()
  File "/home/user/manifest/meta/core/lib/oelite/function.py", line 60, in _start
    self.result = self()
  File "/home/user/manifest/meta/core/lib/oelite/function.py", line 120, in __call__
    retval = self.function(self.meta)
  File "/home/user/manifest/meta/core/classes/s6rc.oeclass", line 18, in s6_use_flags
    use_flags = class_flags + (d.get('RECIPE_FLAGS' or '')).split()
AttributeError: 'NoneType' object has no attribute 'split'

Signed-off-by: Esben Haabendal esben@haabendal.dk

ravi-prevas commented 6 years ago

Woops. Obviously ok, but I think that the real fix is to ensure RECIPE_FLAGS is always at least "" to avoid the need for all the (apparently error-prone) or '' boilerplate everywhere.