Use user_location for PORTDIR variable.
authorZac Medico <zmedico@gentoo.org>
Tue, 12 Oct 2010 01:16:53 +0000 (18:16 -0700)
committerZac Medico <zmedico@gentoo.org>
Tue, 12 Oct 2010 01:16:53 +0000 (18:16 -0700)
pym/portage/package/ebuild/config.py

index 45eae7871cbfca7f6b18e5ed828dfd16cf786fcb..8330390e5d4454b5513c1f2e9ca504701fca7fb0 100644 (file)
@@ -481,8 +481,11 @@ class config(object):
                        self.repositories = load_repository_config(self)
 
                        #filling PORTDIR and PORTDIR_OVERLAY variable for compatibility
-                       self["PORTDIR"] = self.repositories.mainRepoLocation()
-                       self.backup_changes("PORTDIR")
+                       main_repo = self.repositories.mainRepo()
+                       if main_repo is not None:
+                               main_repo = main_repo.user_location
+                               self["PORTDIR"] = main_repo
+                               self.backup_changes("PORTDIR")
                        portdir_overlay = list(self.repositories.repoUserLocationList())
                        if self["PORTDIR"] in portdir_overlay:
                                portdir_overlay.remove(self["PORTDIR"])