Skip to content

Commit

Permalink
west: blobs: prefer constants to literals for blob status
Browse files Browse the repository at this point in the history
Replace blob status literals with the corresponding
constants defined in zephyr_module.

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
(cherry picked from commit ae9326c)
  • Loading branch information
dottspina authored and github-actions[bot] committed Jul 30, 2024
1 parent 36940db commit 86cd706
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions scripts/west_commands/blobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def fetch_blob(self, url, path):
def fetch(self, args):
blobs = self.get_blobs(args)
for blob in blobs:
if blob['status'] == 'A':
if blob['status'] == zephyr_module.BLOB_PRESENT:
log.dbg('Blob {module}: {abspath} is up to date'.format(**blob))
continue
log.inf('Fetching blob {module}: {abspath}'.format(**blob))
Expand All @@ -131,7 +131,7 @@ def fetch(self, args):
def clean(self, args):
blobs = self.get_blobs(args)
for blob in blobs:
if blob['status'] == 'D':
if blob['status'] == zephyr_module.BLOB_NOT_PRESENT:
log.dbg('Blob {module}: {abspath} not in filesystem'.format(**blob))
continue
log.inf('Deleting blob {module}: {status} {abspath}'.format(**blob))
Expand Down
2 changes: 1 addition & 1 deletion scripts/zephyr_module.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, sysbuild=False):

def process_kconfig(module, meta):
blobs = process_blobs(module, meta)
taint_blobs = len(tuple(filter(lambda b: b['status'] != 'D', blobs))) != 0
taint_blobs = any(b['status'] != BLOB_NOT_PRESENT for b in blobs)
section = meta.get('build', dict())
module_path = PurePath(module)
module_yml = module_path.joinpath('zephyr/module.yml')
Expand Down

0 comments on commit 86cd706

Please sign in to comment.