summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
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):