1 |
commit: e5d298ccb05b630f17035f31a79c2fe55b90bf07 |
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: Thu Apr 28 14:48:47 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=e5d298cc |
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 |
Several classwide variables repolevel, reposplit, categories are accessed |
13 |
outside of the scanner class. So therefore can not be made local. |
14 |
|
15 |
pym/repoman/scanner.py | 20 ++++++++++---------- |
16 |
1 file changed, 10 insertions(+), 10 deletions(-) |
17 |
|
18 |
diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py |
19 |
index d966513..a5c54b1 100644 |
20 |
--- a/pym/repoman/scanner.py |
21 |
+++ b/pym/repoman/scanner.py |
22 |
@@ -107,13 +107,13 @@ class Scanner(object): |
23 |
self.repo_settings.repoman_settings['PORTAGE_ARCHLIST'] = ' '.join(sorted(kwlist)) |
24 |
self.repo_settings.repoman_settings.backup_changes('PORTAGE_ARCHLIST') |
25 |
|
26 |
- self.profiles = setup_profile(profile_list) |
27 |
+ profiles = setup_profile(profile_list) |
28 |
|
29 |
- check_profiles(self.profiles, self.repo_settings.repoman_settings.archlist()) |
30 |
+ check_profiles(profiles, self.repo_settings.repoman_settings.archlist()) |
31 |
|
32 |
scanlist = scan(self.repolevel, self.reposplit, startdir, self.categories, self.repo_settings) |
33 |
|
34 |
- self.dev_keywords = dev_profile_keywords(self.profiles) |
35 |
+ self.dev_keywords = dev_profile_keywords(profiles) |
36 |
|
37 |
self.qatracker = self.vcs_settings.qatracker |
38 |
|
39 |
@@ -123,7 +123,7 @@ class Scanner(object): |
40 |
if self.vcs_settings.vcs is None: |
41 |
self.options.echangelog = 'n' |
42 |
|
43 |
- self.checks = {} |
44 |
+ checks = {} |
45 |
# The --echangelog option causes automatic ChangeLog generation, |
46 |
# which invalidates changelog.ebuildadded and changelog.missing |
47 |
# checks. |
48 |
@@ -135,7 +135,7 @@ class Scanner(object): |
49 |
# TODO: shouldn't this just be switched on the repo, iso the VCS? |
50 |
is_echangelog_enabled = self.options.echangelog in ('y', 'force') |
51 |
self.vcs_settings.vcs_is_cvs_or_svn = self.vcs_settings.vcs in ('cvs', 'svn') |
52 |
- self.checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn |
53 |
+ checks['changelog'] = not is_echangelog_enabled and self.vcs_settings.vcs_is_cvs_or_svn |
54 |
|
55 |
if self.options.mode == "manifest" or self.options.quiet: |
56 |
pass |
57 |
@@ -170,7 +170,7 @@ class Scanner(object): |
58 |
|
59 |
# Disable the "self.modules['Ebuild'].notadded" check when not in commit mode and |
60 |
# running `svn status` in every package dir will be too expensive. |
61 |
- self.checks['ebuild_notadded'] = not \ |
62 |
+ checks['ebuild_notadded'] = not \ |
63 |
(self.vcs_settings.vcs == "svn" and self.repolevel < 3 and self.options.mode != "commit") |
64 |
|
65 |
self.effective_scanlist = scanlist |
66 |
@@ -188,9 +188,9 @@ class Scanner(object): |
67 |
"options": self.options, |
68 |
"metadata_xsd": metadata_xsd, |
69 |
"uselist": uselist, |
70 |
- "checks": self.checks, |
71 |
+ "checks": checks, |
72 |
"repo_metadata": self.repo_metadata, |
73 |
- "profiles": self.profiles, |
74 |
+ "profiles": profiles, |
75 |
"include_arches": self.include_arches, |
76 |
"caches": self.caches, |
77 |
"repoman_incrementals": self.repoman_incrementals, |
78 |
@@ -291,7 +291,7 @@ class Scanner(object): |
79 |
checkdirlist = os.listdir(checkdir) |
80 |
|
81 |
# Run the status check |
82 |
- if self.checks['ebuild_notadded']: |
83 |
+ if self.kwargs['checks']['ebuild_notadded']: |
84 |
self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg) |
85 |
|
86 |
dynamic_data = { |
87 |
@@ -350,7 +350,7 @@ class Scanner(object): |
88 |
ebuildlist = sorted(pkgs.values()) |
89 |
ebuildlist = [pkg.pf for pkg in ebuildlist] |
90 |
|
91 |
- if self.checks['changelog'] and "ChangeLog" not in checkdirlist: |
92 |
+ if self.kwargs['checks']['changelog'] and "ChangeLog" not in checkdirlist: |
93 |
self.qatracker.add_error("changelog.missing", xpkg + "/ChangeLog") |
94 |
|
95 |
changelog_path = os.path.join(checkdir_relative, "ChangeLog") |