RepoConfigLoader: masters eclass override order
authorZac Medico <zmedico@gentoo.org>
Tue, 13 Dec 2011 22:19:05 +0000 (14:19 -0800)
committerZac Medico <zmedico@gentoo.org>
Tue, 13 Dec 2011 22:19:05 +0000 (14:19 -0800)
Only append the current repo to eclass_locations if it's not there
already. This allows masters to have more control over eclass override
order, which may be useful for scenarios in which there is a plan to
migrate eclasses to a master repo. Thanks to Brian Harring
<ferringb@gentoo.org) for suggesting this behavior.

pym/portage/repository/config.py

index 4a8d8666eee8c7c67c4eccc1a39d0f92176ac0f0..0222253e25f9028af371e744793715761b4779ca 100644 (file)
@@ -531,7 +531,12 @@ class RepoConfigLoader(object):
 
                        eclass_locations = []
                        eclass_locations.extend(master_repo.location for master_repo in repo.masters)
-                       eclass_locations.append(repo.location)
+                       # Only append the current repo to eclass_locations if it's not
+                       # there already. This allows masters to have more control over
+                       # eclass override order, which may be useful for scenarios in
+                       # which there is a plan to migrate eclasses to a master repo.
+                       if repo.location not in eclass_locations:
+                               eclass_locations.append(repo.location)
 
                        if repo.eclass_overrides:
                                for other_repo_name in repo.eclass_overrides: