Gentoo Archives: gentoo-commits

From: Brian Dolbec <dolsen@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/repoman/modules/scan/status/
Date: Fri, 29 Apr 2016 17:25:09
Message-Id: 1461601931.ac6c5aa13a48bc50b1aa5cfc8cb46ad9c8c42a2b.dolsen@gentoo
1 commit: ac6c5aa13a48bc50b1aa5cfc8cb46ad9c8c42a2b
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Mon Apr 25 16:32:11 2016 +0000
4 Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
5 CommitDate: Mon Apr 25 16:32:11 2016 +0000
6 URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6c5aa1
7
8 repoman: Migrate the vcsstatus code back to scanner.py
9
10 This module had only 2 lines of useful code, the rest was boiler plate module handling code.
11 It was also not dependant on other checks.
12
13 pym/repoman/modules/scan/status/__init__.py | 31 ----------------------
14 pym/repoman/modules/scan/status/vcsstatus.py | 39 ----------------------------
15 pym/repoman/scanner.py | 6 ++++-
16 3 files changed, 5 insertions(+), 71 deletions(-)
17
18 diff --git a/pym/repoman/modules/scan/status/__init__.py b/pym/repoman/modules/scan/status/__init__.py
19 deleted file mode 100644
20 index 1abf580..0000000
21 --- a/pym/repoman/modules/scan/status/__init__.py
22 +++ /dev/null
23 @@ -1,31 +0,0 @@
24 -# Copyright 2015-2016 Gentoo Foundation
25 -# Distributed under the terms of the GNU General Public License v2
26 -
27 -doc = """fetches plug-in module for repoman.
28 -Performs fetch related checks on ebuilds."""
29 -__doc__ = doc[:]
30 -
31 -
32 -module_spec = {
33 - 'name': 'status',
34 - 'description': doc,
35 - 'provides':{
36 - 'status-module': {
37 - 'name': "vcsstatus",
38 - 'sourcefile': "vcsstatus",
39 - 'class': "VCSStatus",
40 - 'description': doc,
41 - 'functions': ['check'],
42 - 'func_desc': {
43 - },
44 - 'mod_kwargs': ['vcs_settings', 'checks',
45 - ],
46 - 'func_kwargs': {
47 - 'checkdir': (None, None),
48 - 'checkdir_relative': (None, None),
49 - 'xpkg': (None, None),
50 - },
51 - },
52 - }
53 -}
54 -
55
56 diff --git a/pym/repoman/modules/scan/status/vcsstatus.py b/pym/repoman/modules/scan/status/vcsstatus.py
57 deleted file mode 100644
58 index ab81a11..0000000
59 --- a/pym/repoman/modules/scan/status/vcsstatus.py
60 +++ /dev/null
61 @@ -1,39 +0,0 @@
62 -# -*- coding:utf-8 -*-
63 -
64 -from repoman.modules.scan.scanbase import ScanBase
65 -
66 -
67 -class VCSStatus(ScanBase):
68 - '''Determines the status of the vcs repositories
69 - to determine if files are not added'''
70 -
71 - def __init__(self, **kwargs):
72 - '''Class init
73 -
74 - @param vcs_settings: VCSSettings instance
75 - '''
76 - super(VCSStatus, self).__init__(**kwargs)
77 - self.vcs_settings = kwargs.get('vcs_settings')
78 - self.check_not_added = kwargs.get("checks")['ebuild_notadded']
79 -
80 - def check(self, **kwargs):
81 - '''Performs an indirect status check via the
82 - correct vcs plugin Status class
83 -
84 - @param check_not_added: boolean
85 - @param checkdir: string, directory path
86 - @param checkdir_relative: repolevel determined path
87 - @param xpkg: the current package being checked
88 - @returns: boolean
89 - '''
90 - checkdir = kwargs.get('checkdir')
91 - checkdir_relative = kwargs.get('checkdir_relative')
92 - xpkg = kwargs.get('xpkg')
93 - if self.check_not_added:
94 - self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
95 - return False
96 -
97 - @property
98 - def runInPkgs(self):
99 - '''Package level scans'''
100 - return (True, [self.check])
101
102 diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
103 index 73187e9..2224fa3 100644
104 --- a/pym/repoman/scanner.py
105 +++ b/pym/repoman/scanner.py
106 @@ -294,6 +294,10 @@ class Scanner(object):
107 checkdir_relative = os.path.join(".", checkdir_relative)
108 checkdirlist = os.listdir(checkdir)
109
110 + # Run the status check
111 + if self.checks['ebuild_notadded']:
112 + self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
113 +
114 dynamic_data = {
115 'checkdirlist': ExtendedFuture(checkdirlist),
116 'checkdir': checkdir,
117 @@ -322,7 +326,7 @@ class Scanner(object):
118 # need to set it up for ==> self.modules or some other ordered list
119 for mod in [('manifests', 'Manifests'), ('isebuild', 'IsEbuild'),
120 ('keywords', 'KeywordChecks'), ('files', 'FileChecks'),
121 - ('vcsstatus', 'VCSStatus'), ('fetches', 'FetchChecks'),
122 + ('fetches', 'FetchChecks'),
123 ('pkgmetadata', 'PkgMetadata'),
124 ]:
125 mod_class = MODULE_CONTROLLER.get_class(mod[0])