public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/modules/scan/status/
  2016-04-29 17:24 [gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/repoman/modules/scan/status/ Brian Dolbec
@ 2016-04-25 16:33 ` Brian Dolbec
  0 siblings, 0 replies; 2+ messages in thread
From: Brian Dolbec @ 2016-04-25 16:33 UTC (permalink / raw
  To: gentoo-commits

commit:     ac6c5aa13a48bc50b1aa5cfc8cb46ad9c8c42a2b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 25 16:32:11 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 16:32:11 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6c5aa1

repoman: Migrate the vcsstatus code back to scanner.py

This module had only 2 lines of useful code, the rest was boiler plate module handling code.
It was also not dependant on other checks.

 pym/repoman/modules/scan/status/__init__.py  | 31 ----------------------
 pym/repoman/modules/scan/status/vcsstatus.py | 39 ----------------------------
 pym/repoman/scanner.py                       |  6 ++++-
 3 files changed, 5 insertions(+), 71 deletions(-)

diff --git a/pym/repoman/modules/scan/status/__init__.py b/pym/repoman/modules/scan/status/__init__.py
deleted file mode 100644
index 1abf580..0000000
--- a/pym/repoman/modules/scan/status/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-doc = """fetches plug-in module for repoman.
-Performs fetch related checks on ebuilds."""
-__doc__ = doc[:]
-
-
-module_spec = {
-	'name': 'status',
-	'description': doc,
-	'provides':{
-		'status-module': {
-			'name': "vcsstatus",
-			'sourcefile': "vcsstatus",
-			'class': "VCSStatus",
-			'description': doc,
-			'functions': ['check'],
-			'func_desc': {
-			},
-			'mod_kwargs': ['vcs_settings', 'checks',
-			],
-			'func_kwargs': {
-				'checkdir': (None, None),
-				'checkdir_relative': (None, None),
-				'xpkg': (None, None),
-			},
-		},
-	}
-}
-

diff --git a/pym/repoman/modules/scan/status/vcsstatus.py b/pym/repoman/modules/scan/status/vcsstatus.py
deleted file mode 100644
index ab81a11..0000000
--- a/pym/repoman/modules/scan/status/vcsstatus.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding:utf-8 -*-
-
-from repoman.modules.scan.scanbase import ScanBase
-
-
-class VCSStatus(ScanBase):
-	'''Determines the status of the vcs repositories
-	to determine if files are not added'''
-
-	def __init__(self, **kwargs):
-		'''Class init
-
-		@param vcs_settings: VCSSettings instance
-		'''
-		super(VCSStatus, self).__init__(**kwargs)
-		self.vcs_settings = kwargs.get('vcs_settings')
-		self.check_not_added = kwargs.get("checks")['ebuild_notadded']
-
-	def check(self, **kwargs):
-		'''Performs an indirect status check via the
-		correct vcs plugin Status class
-
-		@param check_not_added: boolean
-		@param checkdir: string, directory path
-		@param checkdir_relative: repolevel determined path
-		@param xpkg: the current package being checked
-		@returns: boolean
-		'''
-		checkdir = kwargs.get('checkdir')
-		checkdir_relative = kwargs.get('checkdir_relative')
-		xpkg = kwargs.get('xpkg')
-		if self.check_not_added:
-			self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
-		return False
-
-	@property
-	def runInPkgs(self):
-		'''Package level scans'''
-		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 73187e9..2224fa3 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -294,6 +294,10 @@ class Scanner(object):
 			checkdir_relative = os.path.join(".", checkdir_relative)
 			checkdirlist = os.listdir(checkdir)
 
+			# Run the status check
+			if self.checks['ebuild_notadded']:
+				self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
+
 			dynamic_data = {
 				'checkdirlist': ExtendedFuture(checkdirlist),
 				'checkdir': checkdir,
@@ -322,7 +326,7 @@ class Scanner(object):
 			# need to set it up for ==> self.modules or some other ordered list
 			for mod in [('manifests', 'Manifests'), ('isebuild', 'IsEbuild'),
 						('keywords', 'KeywordChecks'), ('files', 'FileChecks'),
-						('vcsstatus', 'VCSStatus'), ('fetches', 'FetchChecks'),
+						('fetches', 'FetchChecks'),
 						('pkgmetadata', 'PkgMetadata'),
 						]:
 				mod_class = MODULE_CONTROLLER.get_class(mod[0])


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/repoman/modules/scan/status/
@ 2016-04-29 17:24 Brian Dolbec
  2016-04-25 16:33 ` [gentoo-commits] proj/portage:repoman " Brian Dolbec
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Dolbec @ 2016-04-29 17:24 UTC (permalink / raw
  To: gentoo-commits

commit:     ac6c5aa13a48bc50b1aa5cfc8cb46ad9c8c42a2b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Apr 25 16:32:11 2016 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Mon Apr 25 16:32:11 2016 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=ac6c5aa1

repoman: Migrate the vcsstatus code back to scanner.py

This module had only 2 lines of useful code, the rest was boiler plate module handling code.
It was also not dependant on other checks.

 pym/repoman/modules/scan/status/__init__.py  | 31 ----------------------
 pym/repoman/modules/scan/status/vcsstatus.py | 39 ----------------------------
 pym/repoman/scanner.py                       |  6 ++++-
 3 files changed, 5 insertions(+), 71 deletions(-)

diff --git a/pym/repoman/modules/scan/status/__init__.py b/pym/repoman/modules/scan/status/__init__.py
deleted file mode 100644
index 1abf580..0000000
--- a/pym/repoman/modules/scan/status/__init__.py
+++ /dev/null
@@ -1,31 +0,0 @@
-# Copyright 2015-2016 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-doc = """fetches plug-in module for repoman.
-Performs fetch related checks on ebuilds."""
-__doc__ = doc[:]
-
-
-module_spec = {
-	'name': 'status',
-	'description': doc,
-	'provides':{
-		'status-module': {
-			'name': "vcsstatus",
-			'sourcefile': "vcsstatus",
-			'class': "VCSStatus",
-			'description': doc,
-			'functions': ['check'],
-			'func_desc': {
-			},
-			'mod_kwargs': ['vcs_settings', 'checks',
-			],
-			'func_kwargs': {
-				'checkdir': (None, None),
-				'checkdir_relative': (None, None),
-				'xpkg': (None, None),
-			},
-		},
-	}
-}
-

diff --git a/pym/repoman/modules/scan/status/vcsstatus.py b/pym/repoman/modules/scan/status/vcsstatus.py
deleted file mode 100644
index ab81a11..0000000
--- a/pym/repoman/modules/scan/status/vcsstatus.py
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- coding:utf-8 -*-
-
-from repoman.modules.scan.scanbase import ScanBase
-
-
-class VCSStatus(ScanBase):
-	'''Determines the status of the vcs repositories
-	to determine if files are not added'''
-
-	def __init__(self, **kwargs):
-		'''Class init
-
-		@param vcs_settings: VCSSettings instance
-		'''
-		super(VCSStatus, self).__init__(**kwargs)
-		self.vcs_settings = kwargs.get('vcs_settings')
-		self.check_not_added = kwargs.get("checks")['ebuild_notadded']
-
-	def check(self, **kwargs):
-		'''Performs an indirect status check via the
-		correct vcs plugin Status class
-
-		@param check_not_added: boolean
-		@param checkdir: string, directory path
-		@param checkdir_relative: repolevel determined path
-		@param xpkg: the current package being checked
-		@returns: boolean
-		'''
-		checkdir = kwargs.get('checkdir')
-		checkdir_relative = kwargs.get('checkdir_relative')
-		xpkg = kwargs.get('xpkg')
-		if self.check_not_added:
-			self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
-		return False
-
-	@property
-	def runInPkgs(self):
-		'''Package level scans'''
-		return (True, [self.check])

diff --git a/pym/repoman/scanner.py b/pym/repoman/scanner.py
index 73187e9..2224fa3 100644
--- a/pym/repoman/scanner.py
+++ b/pym/repoman/scanner.py
@@ -294,6 +294,10 @@ class Scanner(object):
 			checkdir_relative = os.path.join(".", checkdir_relative)
 			checkdirlist = os.listdir(checkdir)
 
+			# Run the status check
+			if self.checks['ebuild_notadded']:
+				self.vcs_settings.status.check(checkdir, checkdir_relative, xpkg)
+
 			dynamic_data = {
 				'checkdirlist': ExtendedFuture(checkdirlist),
 				'checkdir': checkdir,
@@ -322,7 +326,7 @@ class Scanner(object):
 			# need to set it up for ==> self.modules or some other ordered list
 			for mod in [('manifests', 'Manifests'), ('isebuild', 'IsEbuild'),
 						('keywords', 'KeywordChecks'), ('files', 'FileChecks'),
-						('vcsstatus', 'VCSStatus'), ('fetches', 'FetchChecks'),
+						('fetches', 'FetchChecks'),
 						('pkgmetadata', 'PkgMetadata'),
 						]:
 				mod_class = MODULE_CONTROLLER.get_class(mod[0])


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-04-29 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-29 17:24 [gentoo-commits] proj/portage:master commit in: pym/repoman/, pym/repoman/modules/scan/status/ Brian Dolbec
2016-04-25 16:33 ` [gentoo-commits] proj/portage:repoman " Brian Dolbec

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox