Inside summarylist(), it's possible for myglsa.packages.keys() to contain
authorZac Medico <zmedico@gentoo.org>
Sat, 21 Feb 2009 01:55:27 +0000 (01:55 -0000)
committerZac Medico <zmedico@gentoo.org>
Sat, 21 Feb 2009 01:55:27 +0000 (01:55 -0000)
unicode objects, which trigger and exception like this:

   File "//usr/lib64/portage/pym/portage/dep.py", line 535, in __init__
    obj_setattr(self, x, getattr(s, x))
   AttributeError: 'unicode' object has no attribute '__eq__'

To solve this problem, convert unicode objects to plain str before passing
them to the portage api.

svn path=/main/trunk/; revision=12667

bin/glsa-check

index b7b9b47d9eb67b3ed7eadda846e9b3160c11e1d2..3c72f6a53013300c31d734866b341ba0c3845b23 100644 (file)
@@ -176,7 +176,7 @@ def summarylist(myglsalist, fd1=sys.stdout, fd2=sys.stderr):
                                fd1.write("... ")
                else:
                        for pkg in myglsa.packages.keys():
-                               mylist = vardb.match(portage.dep_getkey(pkg))
+                               mylist = vardb.match(portage.dep_getkey(str(pkg)))
                                if len(mylist) > 0:
                                        pkg = color(" ".join(mylist))
                                fd1.write(" " + pkg + " ")