LocationsManager.load_profiles: realpath repos
authorZac Medico <zmedico@gentoo.org>
Thu, 27 Oct 2011 18:29:33 +0000 (11:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Thu, 27 Oct 2011 18:29:33 +0000 (11:29 -0700)
Since we already call realpath on make.profile, we also need to call
realpath on the repo paths that we compare its nodes to.

pym/portage/package/ebuild/_config/LocationsManager.py
pym/portage/package/ebuild/config.py

index a4098ba7bdc34b32c0cb19dbeeb511fd6f42f146..debabed2b2c7a9d715213b8f57bfb23e6b58acae 100644 (file)
@@ -48,9 +48,10 @@ class LocationsManager(object):
                self.config_profile_path = config_profile_path
 
        def load_profiles(self, known_repository_paths):
-               known_repos = [os.path.abspath(x) for x in set(known_repository_paths)]
+               known_repos = set(os.path.realpath(x) for x in known_repository_paths)
                # force a trailing '/' for ease of doing startswith checks
-               known_repos = [(x + '/', parse_layout_conf(x)[0]) for x in known_repos]
+               known_repos = tuple((x + '/', parse_layout_conf(x)[0])
+                       for x in known_repos)
 
                if self.config_profile_path is None:
                        self.config_profile_path = \
index cfbbad49a21e6464256ab77b84a967533584af2f..34a326e498d93b659bfbc50fe49f8cacfce08b95 100644 (file)
@@ -405,7 +405,7 @@ class config(object):
                        for confs in [make_globals, make_conf, self.configdict["env"]]:
                                known_repos.extend(confs.get("PORTDIR", '').split())
                                known_repos.extend(confs.get("PORTDIR_OVERLAY", '').split())
-                       known_repos = set(known_repos)
+                       known_repos = frozenset(known_repos)
 
                        locations_manager.load_profiles(known_repos)