projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3af5846
)
_parse_uri_map: preserve order of URIs
author
Zac Medico
<zmedico@gentoo.org>
Tue, 9 Oct 2012 02:01:45 +0000
(19:01 -0700)
committer
Zac Medico
<zmedico@gentoo.org>
Tue, 9 Oct 2012 02:01:45 +0000
(19:01 -0700)
Returns a dict of tuples instead of a dict of sets.
pym/portage/dbapi/porttree.py
patch
|
blob
|
history
diff --git
a/pym/portage/dbapi/porttree.py
b/pym/portage/dbapi/porttree.py
index dba0ef53d2044d67363dac978288fa551ad34d40..a5945be59da97c9a70e0e7d20684815cdf3ef953 100644
(file)
--- a/
pym/portage/dbapi/porttree.py
+++ b/
pym/portage/dbapi/porttree.py
@@
-1138,9
+1138,14
@@
def _parse_uri_map(cpv, metadata, use=None):
uri_set = uri_map.get(distfile)
if uri_set is None:
- uri_set = set()
+ # Use OrderedDict to preserve order from SRC_URI
+ # while ensuring uniqueness.
+ uri_set = OrderedDict()
uri_map[distfile] = uri_set
- uri_set.add(uri)
- uri = None
+ uri_set[uri] = True
+
+ # Convert OrderedDicts to tuples.
+ for k, v in uri_map.items():
+ uri_map[k] = tuple(v)
return uri_map