summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2018-03-12 16:37:47 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-03-15 06:27:19 -0700
commit2e86184de28ed45c24261b73a830c14a61a89aa5 (patch)
tree943dc2f25734e4a644a5620c3698b9f3c9870102 /scripts
parent8f26f6247185b060d343fd9960341e7a4cf5696b (diff)
downloadpoky-2e86184de28ed45c24261b73a830c14a61a89aa5.tar.gz
build-recipe-list: improvements
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/distro/build-recipe-list.py30
1 files changed, 21 insertions, 9 deletions
diff --git a/scripts/distro/build-recipe-list.py b/scripts/distro/build-recipe-list.py
index 3f5f7c2fcc..2162764850 100755
--- a/scripts/distro/build-recipe-list.py
+++ b/scripts/distro/build-recipe-list.py
@@ -20,15 +20,27 @@ import argparse
20 20
21__version__ = "0.1.0" 21__version__ = "0.1.0"
22 22
23recipenames = [] 23# set of BPNs
24allrecipes = [] 24recipenames = set()
25 25# map of recipe -> data
26allrecipes = {}
27
28def make_bpn(recipe):
29 prefixes = ("nativesdk-",)
30 suffixes = ("-native", "-cross", "-initial", "-intermediate", "-crosssdk", "-cross-canadian")
31 for ix in prefixes + suffixes:
32 if ix in recipe:
33 recipe = recipe.replace(ix, "")
34 return recipe
35
26def gather_recipes(rows): 36def gather_recipes(rows):
27 # store the data into the array
28 for row in rows: 37 for row in rows:
29 if row[0] not in recipenames: 38 recipe = row[0]
30 recipenames.append(row[0]) 39 bpn = make_bpn(recipe)
31 allrecipes.append(row) 40 if bpn not in recipenames:
41 recipenames.add(bpn)
42 if recipe not in allrecipes:
43 allrecipes[recipe] = row
32 44
33def generate_recipe_list(): 45def generate_recipe_list():
34 # machine list 46 # machine list
@@ -60,8 +72,8 @@ def generate_recipe_list():
60 print("file : recipe-list.txt is created with %d entries." % len(recipenames)) 72 print("file : recipe-list.txt is created with %d entries." % len(recipenames))
61 73
62 with open('all-recipe-list.txt', 'w') as f: 74 with open('all-recipe-list.txt', 'w') as f:
63 for recipe in sorted(allrecipes): 75 for recipe, row in sorted(allrecipes.items()):
64 f.write("%s\n" % ','.join([str(data) for data in recipe])) 76 f.write("%s\n" % ','.join(row))
65 77
66 78
67def diff_for_new_recipes(recipe1, recipe2): 79def diff_for_new_recipes(recipe1, recipe2):