mirror of
git://git.yoctoproject.org/layerindex-web.git
synced 2025-07-19 20:59:01 +02:00
update: fix dependency processing
The previous commit broke the layer order, e.g.: A -> B -> C -> D The algorithm is checking the dependencies one by one, and until we find D, add D to layerquery_sorted, and add it "collections", the one in "collections" means it's dependencies are OK, then C, B and A will check against collections, so that update_layer.py will update them one by one. The previous commit added A/B/C/D to collections directly, so that when check against it, all the dependencies are met, thus broke the layer sorting, and then there would be failures if we pass layer A to update_layer.py before B, C and D (suppose they are newly to database). This commit fix the problem. BTW., why I use collections to record the one whose dependencies are matched, but not directly use layerquery_sorted, it is because collections contains both the ones to be added/updated and the ones in database, but layerquery_sorted only contains the ones to be updated/added. Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
parent
611c96883c
commit
f4f2146370
|
@ -348,12 +348,11 @@ def main():
|
||||||
deps = re.search("^LAYERDEPENDS = \"(.*)\"", output, re.M).group(1) or ''
|
deps = re.search("^LAYERDEPENDS = \"(.*)\"", output, re.M).group(1) or ''
|
||||||
recs = re.search("^LAYERRECOMMENDS = \"(.*)\"", output, re.M).group(1) or ''
|
recs = re.search("^LAYERRECOMMENDS = \"(.*)\"", output, re.M).group(1) or ''
|
||||||
|
|
||||||
collections.add((col, ver))
|
|
||||||
|
|
||||||
deps_dict = utils.explode_dep_versions2(bitbakepath, deps + ' ' + recs)
|
deps_dict = utils.explode_dep_versions2(bitbakepath, deps + ' ' + recs)
|
||||||
if len(deps_dict) == 0:
|
if len(deps_dict) == 0:
|
||||||
# No depends, add it firstly
|
# No depends, add it firstly
|
||||||
layerquery_sorted.append(layer)
|
layerquery_sorted.append(layer)
|
||||||
|
collections.add((col, ver))
|
||||||
continue
|
continue
|
||||||
deps_dict_all[layer] = {'requires': deps_dict, 'collection': col, 'version': ver}
|
deps_dict_all[layer] = {'requires': deps_dict, 'collection': col, 'version': ver}
|
||||||
|
|
||||||
|
@ -374,6 +373,7 @@ def main():
|
||||||
# All the depends are in collections:
|
# All the depends are in collections:
|
||||||
del(deps_dict_all[layer])
|
del(deps_dict_all[layer])
|
||||||
layerquery_sorted.append(layer)
|
layerquery_sorted.append(layer)
|
||||||
|
collections.add((value['collection'], value['version']))
|
||||||
|
|
||||||
if not len(deps_dict_all):
|
if not len(deps_dict_all):
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue
Block a user