Skip to content
This repository has been archived by the owner on Jul 17, 2023. It is now read-only.

Commit

Permalink
app: Fix duplicate arch and plat KConfig matching
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Jung <[email protected]>
  • Loading branch information
nderjung committed Feb 24, 2021
1 parent 6121211 commit 4c4fec5
Showing 1 changed file with 22 additions and 15 deletions.
37 changes: 22 additions & 15 deletions kraft/app/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,23 +273,30 @@ def configure(ctx, self, target=None, arch=None, plat=None, options=[],

archs = list()
plats = list()

if target is not None:
archs.append(target.architecture)
plats.append(target.platform)

def match_arch(arch, target):
if isinstance(arch, six.string_types) and \
arch == target.architecture.name:
return target.architecture
if isinstance(arch, Architecture) and \
arch.name == target.architecture.name:
return arch
return None

def match_plat(plat, target):
if isinstance(plat, six.string_types) and \
plat == target.platform.name:
return target.platform
if isinstance(plat, Platform) and \
plat.name == target.platform.name:
return plat
return None

for target in self.config.targets.all():
if isinstance(arch, str):
if arch == target.architecture.name:
archs.append(target.architecture)
elif isinstance(arch, Architecture):
archs.append(arch)

if isinstance(plat, str):
if plat == target.platform.name:
plats.append(target.platform)
elif isinstance(plat, Platform):
plats.append(plat)
if match_arch(arch, target) is not None \
and match_plat(plat, target) is not None:
archs.append(target.architecture)
plats.append(target.platform)

# Generate a dynamic .config to populate defconfig with based on
# configure's parameterization.
Expand Down

0 comments on commit 4c4fec5

Please sign in to comment.