From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 7948713838B for ; Wed, 1 Oct 2014 23:02:43 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 5381DE0869; Wed, 1 Oct 2014 23:02:39 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 67EB8E0869 for ; Wed, 1 Oct 2014 23:02:38 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 76DCA340372 for ; Wed, 1 Oct 2014 23:02:36 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id BF1A46B81 for ; Wed, 1 Oct 2014 23:02:33 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1412204293.598024be9e966eabc42e27ec32bdcbc630035290.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:repoman commit in: pym/repoman/, pym/repoman/vcs/ X-VCS-Repository: proj/portage X-VCS-Files: pym/repoman/main.py pym/repoman/vcs/vcsstatus.py X-VCS-Directories: pym/repoman/vcs/ pym/repoman/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 598024be9e966eabc42e27ec32bdcbc630035290 X-VCS-Branch: repoman Date: Wed, 1 Oct 2014 23:02:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b87869d0-f528-4bde-8ba3-40bd4bcea17e X-Archives-Hash: 1c2b6c629740baecaf199ec021340bb8 commit: 598024be9e966eabc42e27ec32bdcbc630035290 Author: Brian Dolbec gentoo org> AuthorDate: Tue Jun 3 18:42:37 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Wed Oct 1 22:58:13 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=598024be 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: