public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2014-11-17  0:55 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2014-11-17  0:55 UTC (permalink / raw
  To: gentoo-commits

commit:     cad2601ddbac1e2bb931d5d695649a5030b88fb3
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Nov 17 00:53:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=cad2601d

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

---
 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index c19bf94..8197400 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -322,8 +322,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2015-08-10 13:44 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2015-08-10 13:44 UTC (permalink / raw
  To: gentoo-commits

commit:     cf1cd4f77e9f747cfeb195972cb9b3b89b31f54d
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Jul 21 05:47:27 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=cf1cd4f7

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 7cad55c..3db02a1 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -325,8 +325,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2015-08-10 14:45 Michał Górny
  0 siblings, 0 replies; 6+ messages in thread
From: Michał Górny @ 2015-08-10 14:45 UTC (permalink / raw
  To: gentoo-commits

commit:     24f09d9de8d3483615e4721a638a00aac8eba604
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Aug 10 14:45:19 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=24f09d9d

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 9f7c64b..db6c468 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -325,8 +325,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2015-08-11 23:54 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2015-08-11 23:54 UTC (permalink / raw
  To: gentoo-commits

commit:     4a22cff77e57cc4c5cb2913130b046832e867591
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Tue Aug 11 23:52:53 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=4a22cff7

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 9f7c64b..db6c468 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -325,8 +325,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2015-09-17  3:08 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2015-09-17  3:08 UTC (permalink / raw
  To: gentoo-commits

commit:     c293df17dd91282658139a49e66429f9bf4de350
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 03:06:47 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=c293df17

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index e942dca..0b78001 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -325,8 +325,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

* [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
@ 2015-09-17  4:51 Brian Dolbec
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Dolbec @ 2015-09-17  4:51 UTC (permalink / raw
  To: gentoo-commits

commit:     597f0df7782b9e30f2fd4ca592fed484b7014764
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  3 18:42:37 2014 +0000
Commit:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Thu Sep 17 04:41:25 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=597f0df7

Repoman: Refactor VCSStatus to pass non consistent data to the check()

This will facilitae for the initialization of the class before the big xpkg loop.

 pym/repoman/main.py          |  4 ++--
 pym/repoman/vcs/vcsstatus.py | 39 ++++++++++++++++++---------------------
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/pym/repoman/main.py b/pym/repoman/main.py
index 8f6ef20..6b89832 100755
--- a/pym/repoman/main.py
+++ b/pym/repoman/main.py
@@ -325,8 +325,8 @@ for xpkg in effective_scanlist:
 	filescheck.check(checkdir, checkdirlist, checkdir_relative,
 		changed.changed, changed.new)
 #######################
-	status_check = VCSStatus(vcs_settings, checkdir, checkdir_relative, xpkg, qatracker)
-	status_check.check(check_ebuild_notadded)
+	status_check = VCSStatus(vcs_settings, qatracker)
+	status_check.check(check_ebuild_notadded, checkdir, checkdir_relative, xpkg)
 	eadded.extend(status_check.eadded)
 
 #################

diff --git a/pym/repoman/vcs/vcsstatus.py b/pym/repoman/vcs/vcsstatus.py
index 6a81b1b..0517c04 100644
--- a/pym/repoman/vcs/vcsstatus.py
+++ b/pym/repoman/vcs/vcsstatus.py
@@ -13,52 +13,49 @@ class VCSStatus(object):
 	'''Determines the status of the vcs repositories
 	to determine if files are not added'''
 
-	def __init__(self, vcs_settings, checkdir, checkdir_relative, xpkg, qatracker):
+	def __init__(self, vcs_settings, qatracker):
 		self.vcs_settings = vcs_settings
 		self.vcs = vcs_settings.vcs
 		self.eadded = []
-		self.checkdir = checkdir
-		self.checkdir_relative = checkdir_relative
-		self.xpkg = xpkg
 		self.qatracker = qatracker
 
 
-	def check(self, check_not_added):
+	def check(self, check_not_added, checkdir, checkdir_relative, xpkg):
 		if self.vcs and check_not_added:
 			vcscheck = getattr(self, 'check_%s' % self.vcs)
-			vcscheck()
+			vcscheck(checkdir, checkdir_relative, xpkg)
 
 
-	def post_git_hg(self, myf):
+	def post_git_hg(self, myf, xpkg):
 			for l in myf:
 				if l[:-1][-7:] == ".ebuild":
 					self.qatracker.add_error("ebuild.notadded",
-						os.path.join(self.xpkg, os.path.basename(l[:-1])))
+						os.path.join(xpkg, os.path.basename(l[:-1])))
 			myf.close()
 
 
-	def check_git(self):
+	def check_git(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"git ls-files --others %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_hg(self):
+	def check_hg(self, checkdir, checkdir_relative, xpkg):
 		myf = repoman_popen(
 			"hg status --no-status --unknown %s" %
-			(portage._shell_quote(self.checkdir_relative),))
-		self.post_git_hg(myf)
+			(portage._shell_quote(checkdir_relative),))
+		self.post_git_hg(myf, xpkg)
 
 
-	def check_cvs(self):
+	def check_cvs(self, checkdir, checkdir_relative, xpkg):
 			try:
-				myf = open(self.checkdir + "/CVS/Entries", "r")
+				myf = open(checkdir + "/CVS/Entries", "r")
 				myl = myf.readlines()
 				myf.close()
 			except IOError:
 				self.qatracker.add_error("CVS/Entries.IO_error",
-					self.checkdir + "/CVS/Entries")
+					checkdir + "/CVS/Entries")
 				return True
 			for l in myl:
 				if l[0] != "/":
@@ -71,7 +68,7 @@ class VCSStatus(object):
 			return True
 
 
-	def check_svn(self):
+	def check_svn(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"svn status --depth=files --verbose " +
@@ -92,7 +89,7 @@ class VCSStatus(object):
 		try:
 			myf = repoman_popen(
 				"svn status " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:
@@ -105,11 +102,11 @@ class VCSStatus(object):
 		return True
 
 
-	def check_bzr(self):
+	def check_bzr(self, checkdir, checkdir_relative, xpkg):
 		try:
 			myf = repoman_popen(
 				"bzr ls -v --kind=file " +
-				portage._shell_quote(self.checkdir))
+				portage._shell_quote(checkdir))
 			myl = myf.readlines()
 			myf.close()
 		except IOError:


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

end of thread, other threads:[~2015-09-17  4:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-11 23:54 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2015-09-17  4:51 Brian Dolbec
2015-09-17  3:08 Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-10 13:44 Brian Dolbec
2014-11-17  0:55 Brian Dolbec

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