Merged from trunk -r15027:15029
authorFabian Groffen <grobian@gentoo.org>
Sat, 12 Dec 2009 11:48:35 +0000 (11:48 -0000)
committerFabian Groffen <grobian@gentoo.org>
Sat, 12 Dec 2009 11:48:35 +0000 (11:48 -0000)
   | 15028   | Use collections.OrderedDict when available (python-2.7) and  |
   | zmedico | fall back to portage.cache.mappings.OrderedDict for older    |
   |         | python. Also, use OrderedDict inside fetch() so that files   |
   |         | are fetched in the order that they appear in SRC_URI.        |

   | 15029   | Don't use lazy import for portage.cache.mappings because     |
   | zmedico | it's imported anyway.                                        |

svn path=/main/branches/prefix/; revision=15053

pym/portage/__init__.py
pym/portage/dbapi/porttree.py

index 9eccf5c33adef2f97f144787b61729ad13b4388a..8562da917a741237299aa3bbeca242f3e30a71bd 100644 (file)
@@ -67,6 +67,12 @@ except ImportError as e:
        raise
 
 try:
+
+       try:
+               from collections import OrderedDict
+       except ImportError:
+               from portage.cache.mappings import OrderedDict
+
        from portage.cache.cache_errors import CacheError
        import portage.proxy.lazyimport
        import portage.proxy as proxy
@@ -4550,7 +4556,7 @@ def fetch(myuris, mysettings, listonly=0, fetchonly=0, locks_in_subdir=".locks",
                for myuri in myuris:
                        file_uri_tuples.append((os.path.basename(myuri), myuri))
 
-       filedict={}
+       filedict = OrderedDict()
        primaryuri_indexes={}
        primaryuri_dict = {}
        thirdpartymirror_uris = {}
index df2c65640838f97a00000da64f6d1e9144693c36..825ca821c9cf80cf6560071e8b05279461bc3b4c 100644 (file)
@@ -16,7 +16,6 @@ portage.proxy.lazyimport.lazyimport(globals(),
 )
 
 from portage.cache.cache_errors import CacheError
-from portage.cache.mappings import OrderedDict
 from portage.const import REPO_NAME_LOC
 from portage.data import portage_gid, secpass
 from portage.dbapi import dbapi
@@ -32,6 +31,7 @@ from portage import os
 from portage import _encodings
 from portage import _unicode_decode
 from portage import _unicode_encode
+from portage import OrderedDict
 
 import os as _os
 import codecs