commit:     125d92736ef9c87077cf32b8fb254fef4a52fbc1
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Apr 27 03:12:53 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Wed Apr 27 05:20:31 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=125d9273

repoman/scanner.py: Make some variables  local instead of classwide

Some were not needed outside of __init__.
Some are included  self.kwargs.

 pym/repoman/scanner.py | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index d966513..46e9d85 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -75,11 +75,11 @@ class Scanner(object):
                        self.portdb._aux_cache_keys.update(
                                ["EAPI", "IUSE", "KEYWORDS", "repository", 
"SLOT"])
 
-               self.reposplit = myreporoot.split(os.path.sep)
-               self.repolevel = len(self.reposplit)
+               reposplit = myreporoot.split(os.path.sep)
+               self.repolevel = len(reposplit)
 
                if self.options.mode == 'commit':
-                       repochecks.commit_check(self.repolevel, self.reposplit)
+                       repochecks.commit_check(self.repolevel, reposplit)
                        repochecks.conflict_check(self.vcs_settings, 
self.options)
 
                # Make startdir relative to the canonical repodir, so that we 
can pass
@@ -107,13 +107,13 @@ class Scanner(object):
                self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' 
'.join(sorted(kwlist))
                
self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST')
 
-               self.profiles = setup_profile(profile_list)
+               profiles = setup_profile(profile_list)
 
-               check_profiles(self.profiles, 
self.repo_settings.repoman_settings.archlist())
+               check_profiles(profiles, 
self.repo_settings.repoman_settings.archlist())
 
-               scanlist = scan(self.repolevel, self.reposplit, startdir, 
self.categories, self.repo_settings)
+               scanlist = scan(self.repolevel, reposplit, startdir, 
self.categories, self.repo_settings)
 
-               self.dev_keywords = dev_profile_keywords(self.profiles)
+               self.dev_keywords = dev_profile_keywords(profiles)
 
                self.qatracker = self.vcs_settings.qatracker
 
@@ -123,7 +123,7 @@ class Scanner(object):
                if self.vcs_settings.vcs is None:
                        self.options.echangelog = 'n'
 
-               self.checks = {}
+               checks = {}
                # The --echangelog option causes automatic ChangeLog generation,
                # which invalidates changelog.ebuildadded and changelog.missing
                # checks.
@@ -135,7 +135,7 @@ class Scanner(object):
                # TODO: shouldn't this just be switched on the repo, iso the 
VCS?
                is_echangelog_enabled = self.options.echangelog in ('y', 
'force')
                self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in 
('cvs', 'svn')
-               self.checks['changelog'] = not is_echangelog_enabled and 
self.vcs_settings.vcs_is_cvs_or_svn
+               checks['changelog'] = not is_echangelog_enabled and 
self.vcs_settings.vcs_is_cvs_or_svn
 
                if self.options.mode == "manifest" or self.options.quiet:
                        pass
@@ -170,14 +170,14 @@ class Scanner(object):
 
                # Disable the "self.modules['Ebuild'].notadded" check when not 
in commit mode and
                # running `svn status` in every package dir will be too 
expensive.
-               self.checks['ebuild_notadded'] = not \
+               checks['ebuild_notadded'] = not \
                        (self.vcs_settings.vcs == "svn" and self.repolevel < 3 
and self.options.mode != "commit")
 
                self.effective_scanlist = scanlist
                if self.options.if_modified == "y":
                        self.effective_scanlist = sorted(vcs_files_to_cps(
                                chain(self.changed.changed, self.changed.new, 
self.changed.removed),
-                               self.repolevel, self.reposplit, 
self.categories))
+                               self.repolevel, reposplit, self.categories))
 
                # Create our kwargs dict here to initialize the plugins with
                self.kwargs = {
@@ -188,9 +188,9 @@ class Scanner(object):
                        "options": self.options,
                        "metadata_xsd": metadata_xsd,
                        "uselist": uselist,
-                       "checks": self.checks,
+                       "checks": checks,
                        "repo_metadata": self.repo_metadata,
-                       "profiles": self.profiles,
+                       "profiles": profiles,
                        "include_arches": self.include_arches,
                        "caches": self.caches,
                        "repoman_incrementals": self.repoman_incrementals,
@@ -291,7 +291,7 @@ class Scanner(object):
                        checkdirlist = os.listdir(checkdir)
 
                        # Run the status check
-                       if self.checks['ebuild_notadded']:
+                       if self.kwargs['checks']['ebuild_notadded']:
                                self.vcs_settings.status.check(checkdir, 
checkdir_relative, xpkg)
 
                        dynamic_data = {
@@ -350,7 +350,7 @@ class Scanner(object):
                        ebuildlist = sorted(pkgs.values())
                        ebuildlist = [pkg.pf for pkg in ebuildlist]
 
-                       if self.checks['changelog'] and "ChangeLog" not in 
checkdirlist:
+                       if self.kwargs['checks']['changelog'] and "ChangeLog" 
not in checkdirlist:
                                self.qatracker.add_error("changelog.missing", 
xpkg + "/ChangeLog")
 
                        changelog_path = os.path.join(checkdir_relative, 
"ChangeLog")

Reply via email to