Exchanging packageSack.returnNewestByNameArch() and packageSack.returnNewestByName() does not work and raises an uncaught exception. The former returns a list, the latter a list of lists, which leads to a run-time error inside the packageSack module: AttributeError: 'list' object has no attribute 'returnSimple' The documentation doesn't say anything about that difference. Full traceback below. I believe the implementation of returnNewestByName() is wrong. Patch attached, too. At least FC5 and FC4 are affected. Traceback (most recent call last): File "./rc-modified", line 201, in ? main() File "./rc-modified", line 169, in main baddeps = my.getBrokenDeps(opts.newest) File "./rc-modified", line 96, in getBrokenDeps mypkgSack = ListPackageSack(pkgs) File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 521, in __ init__ self.addList(Objlist) File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 525, in ad dList self.addPackage(pkgobj) File "/usr/lib/python2.4/site-packages/repomd/packageSack.py", line 163, in ad dPackage repoid = obj.returnSimple('repoid') AttributeError: 'list' object has no attribute 'returnSimple'
Created attachment 128092 [details] patch against yum-2.6.0-1 packageSack.py
At a second thought, probably returnNewestByName() is correct, so it can return a list of multiple package with the same EVR but different archs. In that case, the API documentation is incomplete, and pkgs = pkgSack.returnNewestByName() mypkgSack = ListPackageSack(pkgs) still gives a traceback.
Created attachment 128093 [details] patch returnNewestByName to make it return a list
This has all been cleaned up and made consistent in yum 2.9.x
Still reproducible with yum-3.0-3. Just call yumBase.pkgSack.returnNewestByName() with default argument, and it creates a "list of lists of package objects" rather than a "list of package objects": File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 298, in returnNewestByName bestofeach.addList(self._computeAggregateListResult("returnNewestByName", name)) File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 651, in addList self.addPackage(pkgobj) File "/usr/lib/python2.4/site-packages/yum/packageSack.py", line 475, in addPackage repoid = obj.returnSimple('repoid') AttributeError: 'list' object has no attribute 'returnSimple'
grrr. This is the combination happening. okay I know what's going on here. Thanks Michael.
*** Bug 220841 has been marked as a duplicate of this bug. ***
This looks fixed in 3.0.6/3.1.6 to me