From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/
Date: Mon, 17 Nov 2014 00:55:25 +0000 (UTC) [thread overview]
Message-ID: <1416185593.cad2601ddbac1e2bb931d5d695649a5030b88fb3.dol-sen@gentoo> (raw)
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:
next reply other threads:[~2014-11-17 0:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-17 0:55 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-08-10 13:44 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/vcs/, pym/repoman/ Brian Dolbec
2015-08-10 14:45 Michał Górny
2015-08-11 23:54 Brian Dolbec
2015-09-17 3:08 Brian Dolbec
2015-09-17 4:51 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1416185593.cad2601ddbac1e2bb931d5d695649a5030b88fb3.dol-sen@gentoo \
--to=brian.dolbec@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox