remove __pycache__ from the recipe list, and fix the hostlibffi recipe so it displays correctly in ./toolchain status

This commit is contained in:
Kjell Wooding 2019-01-12 17:26:09 -05:00
parent 8022c268bb
commit 545d24e010
2 changed files with 26 additions and 2 deletions

View file

@ -19,6 +19,9 @@ class LibffiRecipe(Recipe):
for arch in self.filtered_archs:
self.build(arch)
# since we don't run cache_execution, call this here for `status`
self.update_state("{}.build_all".format(self.name), True)
def prebuild_arch(self, arch):
if self.has_marker("patched"):
return

View file

@ -61,8 +61,7 @@ def cache_execution(f):
return
print("{} {}".format(f.__name__.capitalize(), self.name))
f(self, *args, **kwargs)
state[key] = True
state[key_time] = str(datetime.utcnow())
self.update_state(key, True)
return _cache_execution
@ -779,6 +778,19 @@ class Recipe(object):
self.delete_marker("building")
self.set_marker("build_done")
def update_state(self, key, value):
"""Update entry in state database
This is usually done in the @cache_execution decorator
to log an action and its time of occurrence,
but it needs to be done manually in recipes.
sets key = value, and key.at = current_datetime
"""
key_time = "{}.at".format(key)
self.ctx.state[key] = value
self.ctx.state[key_time] = str(datetime.utcnow())
@cache_execution
def build_all(self):
filtered_archs = self.filtered_archs
@ -828,6 +840,15 @@ class Recipe(object):
if hasattr(self, postbuild):
getattr(self, postbuild)()
def update_state(self, key, value):
"""Update entry in state database
Also adds the time of update
"""
key_time = "{}.at".format(key)
self.ctx.state[key] = value
self.ctx.state[key_time] = str(datetime.utcnow())
@cache_execution
def make_lipo(self, filename, library=None):
if library is None: