Make portdbapi.getfetchlist() return an equal number of uris/file names so
authorZac Medico <zmedico@gentoo.org>
Tue, 5 May 2009 08:18:53 +0000 (08:18 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 5 May 2009 08:18:53 +0000 (08:18 -0000)
that no information is lost.

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

pym/portage/dbapi/porttree.py

index 2fc55ccc924801d1dbe9965837fa82994cc5b2b6..3b160a2c471388368045e41088cf97080e6fa953 100644 (file)
@@ -719,10 +719,15 @@ class portdbapi(dbapi):
                        mysettings.setcpv(mypkg, mydb=self)
                        useflags = mysettings["PORTAGE_USE"].split()
                uri_map = self.getFetchMap(mypkg, useflags=useflags, mytree=mytree)
-               uris = set()
-               for uri_set in uri_map.itervalues():
-                       uris.update(uri_set)
-               return [list(uris), uri_map.keys()]
+
+               all_uris = []
+               all_files = []
+               for filename, uris in uri_map.iteritems():
+                       for uri in uris:
+                               all_uris.append(uri)
+                               all_files.append(filename)
+
+               return [all_uris, all_files]
 
        def getfetchsizes(self, mypkg, useflags=None, debug=0):
                # returns a filename:size dictionnary of remaining downloads