commit:     10647652ebeff52c3dbc0419ab9030ba76d46122
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Dec  8 06:58:36 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Dec  8 06:58:36 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=10647652

portage.repository.config.RepoConfig: Delete user_location attribute and 
consistently use location attribute everywhere.

 pym/portage/package/ebuild/config.py    |  4 ++--
 pym/portage/repository/config.py        | 21 ++++++---------------
 pym/portage/tests/ebuild/test_config.py |  4 ++--
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/pym/portage/package/ebuild/config.py 
b/pym/portage/package/ebuild/config.py
index 7cf5a4c..b6217e7 100644
--- a/pym/portage/package/ebuild/config.py
+++ b/pym/portage/package/ebuild/config.py
@@ -539,13 +539,13 @@ class config(object):
                        #filling PORTDIR and PORTDIR_OVERLAY variable for 
compatibility
                        main_repo = self.repositories.mainRepo()
                        if main_repo is not None:
-                               self["PORTDIR"] = main_repo.user_location
+                               self["PORTDIR"] = main_repo.location
                                self.backup_changes("PORTDIR")
                                expand_map["PORTDIR"] = self["PORTDIR"]
 
                        # repoman controls PORTDIR_OVERLAY via the environment, 
so no
                        # special cases are needed here.
-                       portdir_overlay = 
list(self.repositories.repoUserLocationList())
+                       portdir_overlay = 
list(self.repositories.repoLocationList())
                        if portdir_overlay and portdir_overlay[0] == 
self["PORTDIR"]:
                                portdir_overlay = portdir_overlay[1:]
 

diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index b987b56..b792d78 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -91,8 +91,8 @@ class RepoConfig(object):
                'profile_formats', 'sign_commit', 'sign_manifest',
                'sync_depth', 'sync_hooks_only_on_change',
                'sync_type', 'sync_umask', 'sync_uri', 'sync_user', 
'thin_manifest',
-               'update_changelog', 'user_location', '_eapis_banned',
-               '_eapis_deprecated', '_masters_orig', 'module_specific_options',
+               'update_changelog', '_eapis_banned', '_eapis_deprecated',
+               '_masters_orig', 'module_specific_options',
                )
 
        def __init__(self, name, repo_opts, local_config=True):
@@ -189,7 +189,6 @@ class RepoConfig(object):
                self.format = format
 
                location = repo_opts.get('location')
-               self.user_location = location
                if location is not None and location.strip():
                        if os.path.isdir(location) or portage._sync_mode:
                                location = os.path.realpath(location)
@@ -410,8 +409,8 @@ class RepoConfig(object):
                repo_msg.append(self.name)
                if self.format:
                        repo_msg.append(indent + "format: " + self.format)
-               if self.user_location:
-                       repo_msg.append(indent + "location: " + 
self.user_location)
+               if self.location:
+                       repo_msg.append(indent + "location: " + self.location)
                if self.sync_type:
                        repo_msg.append(indent + "sync-type: " + self.sync_type)
                if self.sync_umask:
@@ -527,7 +526,7 @@ class RepoConfigLoader(object):
                                                        old_location == 
default_portdir):
                                                        
ignored_map.setdefault(repo.name, []).append(old_location)
                                                        if old_location == 
portdir:
-                                                               portdir = 
repo.user_location
+                                                               portdir = 
repo.location
 
                                        if repo.priority is None:
                                                if base_priority == 0 and ov == 
portdir_orig:
@@ -826,7 +825,7 @@ class RepoConfigLoader(object):
                                master_repos = []
                                for master_name in repo.masters:
                                        if master_name not in prepos:
-                                               layout_filename = 
os.path.join(repo.user_location,
+                                               layout_filename = 
os.path.join(repo.location,
                                                        "metadata", 
"layout.conf")
                                                writemsg_level(_("Unavailable 
repository '%s' " \
                                                        "referenced by masters 
entry in '%s'\n") % \
@@ -907,14 +906,6 @@ class RepoConfigLoader(object):
                        self._prepos_changed = False
                return self._repo_location_list
 
-       def repoUserLocationList(self):
-               """Get a list of repositories location. Replaces 
PORTDIR_OVERLAY"""
-               user_location_list = []
-               for repo in self.prepos_order:
-                       if self.prepos[repo].location is not None:
-                               
user_location_list.append(self.prepos[repo].user_location)
-               return tuple(user_location_list)
-
        def mainRepoLocation(self):
                """Returns the location of main repo"""
                main_repo = self.prepos['DEFAULT'].main_repo

diff --git a/pym/portage/tests/ebuild/test_config.py 
b/pym/portage/tests/ebuild/test_config.py
index 20aac51..1dd8285 100644
--- a/pym/portage/tests/ebuild/test_config.py
+++ b/pym/portage/tests/ebuild/test_config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2014 Gentoo Foundation
+# Copyright 2010-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -252,7 +252,7 @@ class ConfigTestCase(TestCase):
                new_repo_config = settings.repositories["new_repo"]
                old_repo_config = settings.repositories["old_repo"]
                self.assertTrue(len(new_repo_config.masters) > 0, "new_repo has 
no default master")
-               self.assertEqual(new_repo_config.masters[0].user_location, 
playground.settings.repositories["test_repo"].location,
+               self.assertEqual(new_repo_config.masters[0].location, 
playground.settings.repositories["test_repo"].location,
                        "new_repo default master is not test_repo")
                self.assertEqual(new_repo_config.thin_manifest, True,
                        "new_repo_config.thin_manifest != True")

Reply via email to