Avoid reapath('') expansion to cwd for repos.
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Oct 2010 01:22:47 +0000 (18:22 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Oct 2010 01:22:47 +0000 (18:22 -0700)
pym/portage/repository/config.py

index 35ddd140a07be9bd49b89ee5d7966b0a84cd4d45..f9c7911ab35bb039030226a07facbb03009c969c 100644 (file)
@@ -80,9 +80,11 @@ class RepoConfig(object):
 
                location = repo_opts.get('location')
                self.user_location = location
-               if location is not None:
+               if location is not None and location.strip():
                        if os.path.isdir(location):
                                location = os.path.realpath(location)
+               else:
+                       location = None
                self.location = location
 
                missing = True
@@ -265,7 +267,9 @@ class RepoConfigLoader(object):
                ignored_map = {}
                ignored_location_map = {}
 
-               portdir = os.path.realpath(settings.get('PORTDIR', ''))
+               portdir = settings.get('PORTDIR', '')
+               if portdir and portdir.strip():
+                       portdir = os.path.realpath(portdir)
                portdir_overlay = settings.get('PORTDIR_OVERLAY', '')
                parse(paths, prepos, ignored_map, ignored_location_map)
                add_overlays(portdir, portdir_overlay, prepos, ignored_map, ignored_location_map)