Skip to content

Commit ae9326c

Browse files
dottspinafabiobaltieri
authored andcommitted
west: blobs: prefer constants to literals for blob status
Replace blob status literals with the corresponding constants defined in zephyr_module. Signed-off-by: Christophe Dufaza <[email protected]>
1 parent 043aa83 commit ae9326c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

scripts/west_commands/blobs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ def fetch_blob(self, url, path):
122122
def fetch(self, args):
123123
blobs = self.get_blobs(args)
124124
for blob in blobs:
125-
if blob['status'] == 'A':
125+
if blob['status'] == zephyr_module.BLOB_PRESENT:
126126
log.dbg('Blob {module}: {abspath} is up to date'.format(**blob))
127127
continue
128128
log.inf('Fetching blob {module}: {abspath}'.format(**blob))
@@ -131,7 +131,7 @@ def fetch(self, args):
131131
def clean(self, args):
132132
blobs = self.get_blobs(args)
133133
for blob in blobs:
134-
if blob['status'] == 'D':
134+
if blob['status'] == zephyr_module.BLOB_NOT_PRESENT:
135135
log.dbg('Blob {module}: {abspath} not in filesystem'.format(**blob))
136136
continue
137137
log.inf('Deleting blob {module}: {status} {abspath}'.format(**blob))

scripts/zephyr_module.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ def kconfig_snippet(meta, path, kconfig_file=None, blobs=False, sysbuild=False):
345345

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

0 commit comments

Comments
 (0)