1 |
commit: 125d92736ef9c87077cf32b8fb254fef4a52fbc1 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Apr 27 03:12:53 2016 +0000 |
4 |
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Apr 27 05:20:31 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=125d9273 |
7 |
|
8 |
repoman/scanner.py: Make some variables local instead of classwide |
9 |
|
10 |
Some were not needed outside of __init__. |
11 |
Some are included self.kwargs. |
12 |
|
13 |
pym/repoman/scanner.py | 30 +++++++++++++++--------------- |
14 |
1 file changed, 15 insertions(+), 15 deletions(-) |
15 |
|
16 |
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py |
17 |
index d966513..46e9d85 100644 |
18 |
--- a/pym/repoman/scanner.py |
19 |
+++ b/pym/repoman/scanner.py |
20 |
@@ -75,11 +75,11 @@ class Scanner(object): |
21 |
self.portdb._aux_cache_keys.update( |
22 |
["EAPI", "IUSE", "KEYWORDS", "repository", "SLOT"]) |
23 |
|
24 |
- self.reposplit = myreporoot.split(os.path.sep) |
25 |
- self.repolevel = len(self.reposplit) |
26 |
+ reposplit = myreporoot.split(os.path.sep) |
27 |
+ self.repolevel = len(reposplit) |
28 |
|
29 |
if self.options.mode == 'commit': |
30 |
- repochecks.commit_check(self.repolevel, self.reposplit) |
31 |
+ repochecks.commit_check(self.repolevel, reposplit) |
32 |
repochecks.conflict_check(self.vcs_settings, self.options) |
33 |
|
34 |
# Make startdir relative to the canonical repodir, so that we can pass |
35 |
@@ -107,13 +107,13 @@ class Scanner(object): |
36 |
self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist)) |
37 |
self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST') |
38 |
|
39 |
- self.profiles = setup_profile(profile_list) |
40 |
+ profiles = setup_profile(profile_list) |
41 |
|
42 |
- check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist()) |
43 |
+ check_profiles(profiles, self.repo_settings.repoman_settings.archlist()) |
44 |
|
45 |
- scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings) |
46 |
+ scanlist = scan(self.repolevel, reposplit, startdir, self.categories, self.repo_settings) |
47 |
|
48 |
- self.dev_keywords = dev_profile_keywords(self.profiles) |
49 |
+ self.dev_keywords = dev_profile_keywords(profiles) |
50 |
|
51 |
self.qatracker = self.vcs_settings.qatracker |
52 |
|
53 |
@@ -123,7 +123,7 @@ class Scanner(object): |
54 |
if self.vcs_settings.vcs is None: |
55 |
self.options.echangelog = 'n' |
56 |
|
57 |
- self.checks = {} |
58 |
+ checks = {} |
59 |
# The --echangelog option causes automatic ChangeLog generation, |
60 |
# which invalidates changelog.ebuildadded and changelog.missing |
61 |
# checks. |
62 |
@@ -135,7 +135,7 @@ class Scanner(object): |
63 |
# TODO: shouldn't this just be switched on the repo, iso the VCS? |
64 |
is_echangelog_enabled = self.options.echangelog in ('y', 'force') |
65 |
self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn') |
66 |
- self.checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn |
67 |
+ checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn |
68 |
|
69 |
if self.options.mode == "manifest" or self.options.quiet: |
70 |
pass |
71 |
@@ -170,14 +170,14 @@ class Scanner(object): |
72 |
|
73 |
# Disable the "self.modules['Ebuild'].notadded" check when not in commit mode and |
74 |
# running `svn status` in every package dir will be too expensive. |
75 |
- self.checks['ebuild_notadded'] = not \ |
76 |
+ checks['ebuild_notadded'] = not \ |
77 |
(self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit") |
78 |
|
79 |
self.effective_scanlist = scanlist |
80 |
if self.options.if_modified == "y": |
81 |
self.effective_scanlist = sorted(vcs_files_to_cps( |
82 |
chain(self.changed.changed, self.changed.new, self.changed.removed), |
83 |
- self.repolevel, self.reposplit, self.categories)) |
84 |
+ self.repolevel, reposplit, self.categories)) |
85 |
|
86 |
# Create our kwargs dict here to initialize the plugins with |
87 |
self.kwargs = { |
88 |
@@ -188,9 +188,9 @@ class Scanner(object): |
89 |
"options": self.options, |
90 |
"metadata_xsd": metadata_xsd, |
91 |
"uselist": uselist, |
92 |
- "checks": self.checks, |
93 |
+ "checks": checks, |
94 |
"repo_metadata": self.repo_metadata, |
95 |
- "profiles": self.profiles, |
96 |
+ "profiles": profiles, |
97 |
"include_arches": self.include_arches, |
98 |
"caches": self.caches, |
99 |
"repoman_incrementals": self.repoman_incrementals, |
100 |
@@ -291,7 +291,7 @@ class Scanner(object): |
101 |
checkdirlist = os.listdir(checkdir) |
102 |
|
103 |
# Run the status check |
104 |
- if self.checks['ebuild_notadded']: |
105 |
+ if self.kwargs['checks']['ebuild_notadded']: |
106 |
self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg) |
107 |
|
108 |
dynamic_data = { |
109 |
@@ -350,7 +350,7 @@ class Scanner(object): |
110 |
ebuildlist = sorted(pkgs.values()) |
111 |
ebuildlist = [pkg.pf for pkg in ebuildlist] |
112 |
|
113 |
- if self.checks['changelog'] and "ChangeLog" not in checkdirlist: |
114 |
+ if self.kwargs['checks']['changelog'] and "ChangeLog" not in checkdirlist: |
115 |
self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog") |
116 |
|
117 |
changelog_path = os.path.join(checkdir_relative, "ChangeLog") |