1
0
mirror of https://git.yoctoproject.org/poky synced 2026-06-01 00:59:48 +00:00

ui/crumbs/tasklistmodel: prevent packages depending on each other

Don't add y to x's COL_BINB if x is in y's COL_BINB - prevent circular
dependencies.

Further this patch improves the variable naming to make this code easier to
follow.

Fixes [YOCTO #1423]

(Bitbake rev: 01ef2ab0d201f3cb3666462558c9cf485592e04f)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock
2011-08-29 17:02:39 -07:00
committed by Richard Purdie
parent e2a3f28330
commit 9a047762cf
+22 -20
View File
@@ -434,39 +434,41 @@ class TaskListModel(gtk.ListStore):
Add this item, and any of its dependencies, to the image contents Add this item, and any of its dependencies, to the image contents
""" """
def include_item(self, item_path, binb="", image_contents=False): def include_item(self, item_path, binb="", image_contents=False):
name = self[item_path][self.COL_NAME] item_name = self[item_path][self.COL_NAME]
deps = self[item_path][self.COL_DEPS] item_deps = self[item_path][self.COL_DEPS]
cur_inc = self[item_path][self.COL_INC] item_inc = self[item_path][self.COL_INC]
if not cur_inc: if not item_inc:
self[item_path][self.COL_INC] = True self[item_path][self.COL_INC] = True
bin = self[item_path][self.COL_BINB].split(', ') item_bin = self[item_path][self.COL_BINB].split(', ')
if not binb in bin: if not binb in item_bin:
bin.append(binb) item_bin.append(binb)
self[item_path][self.COL_BINB] = ', '.join(bin).lstrip(', ') self[item_path][self.COL_BINB] = ', '.join(item_bin).lstrip(', ')
# We want to do some magic with things which are brought in by the # We want to do some magic with things which are brought in by the
# base image so tag them as so # base image so tag them as so
if image_contents: if image_contents:
self[item_path][self.COL_IMG] = True self[item_path][self.COL_IMG] = True
if self[item_path][self.COL_TYPE] == 'image': if self[item_path][self.COL_TYPE] == 'image':
self.selected_image = name self.selected_image = item_name
if deps: if item_deps:
# add all of the deps and set their binb to this item # add all of the deps and set their binb to this item
for dep in deps.split(" "): for dep in item_deps.split(" "):
# If the contents model doesn't already contain dep, add it # If the contents model doesn't already contain dep, add it
dep_included = self.contents_includes_name(dep) dep_included = self.contents_includes_name(dep)
path = self.find_path_for_item(dep) dep_path = self.find_path_for_item(dep)
if not path: if not dep_path:
continue continue
if dep_included: if dep_included and not dep in item_bin:
bin = self[path][self.COL_BINB].split(', ') # don't set the COL_BINB to this item if the target is an
if not name in bin: # item in our own COL_BINB
bin.append(name) dep_bin = self[dep_path][self.COL_BINB].split(', ')
self[path][self.COL_BINB] = ', '.join(bin).lstrip(', ') if not item_name in dep_bin:
else: dep_bin.append(item_name)
self.include_item(path, binb=name, image_contents=image_contents) self[dep_path][self.COL_BINB] = ', '.join(dep_bin).lstrip(', ')
elif not dep_included:
self.include_item(dep_path, binb=item_name, image_contents=image_contents)
""" """
Find the model path for the item_name Find the model path for the item_name