From: "Brian Dolbec" <dolsen@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/vcs/
Date: Sat, 5 Sep 2015 21:27:32 +0000 (UTC) [thread overview]
Message-ID: <1441488418.ad7af05dbac5cd201e7f02c797d7a4263fd6ce02.dolsen@gentoo> (raw)
commit: ad7af05dbac5cd201e7f02c797d7a4263fd6ce02
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: Sat Sep 5 21:26:58 2015 +0000
URL: https://gitweb.gentoo.org/proj/portage.git/commit/?id=ad7af05d
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:
next reply other threads:[~2015-09-05 21:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-05 21:27 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-05 21:48 [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/vcs/ Brian Dolbec
2014-10-01 23:46 Brian Dolbec
2014-10-01 23:02 Brian Dolbec
2014-06-03 19:33 Brian Dolbec
2014-05-30 19:25 Brian Dolbec
2014-05-30 13:03 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=1441488418.ad7af05dbac5cd201e7f02c797d7a4263fd6ce02.dolsen@gentoo \
--to=dolsen@gentoo.org \
--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