public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/cvs/
@ 2014-12-06  4:45 Brian Dolbec
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Dolbec @ 2014-12-06  4:45 UTC (permalink / raw
  To: gentoo-commits

commit:     570e6b0c41ece48dddcfd821293ad2f42aa0fc08
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Sat Dec  6 04:44:12 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Dec  6 04:44:12 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=570e6b0c

portage/sync/modules/cvs/__init__.py: fix missed parameter change in CheckSyncConfig

Test and fix supplied by Mike Gilbert <floppym>.

---
 pym/portage/sync/modules/cvs/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/sync/modules/cvs/__init__.py b/pym/portage/sync/modules/cvs/__init__.py
index abf547f..0f4a029 100644
--- a/pym/portage/sync/modules/cvs/__init__.py
+++ b/pym/portage/sync/modules/cvs/__init__.py
@@ -12,8 +12,8 @@ from portage.util import writemsg_level
 
 class CheckCVSConfig(CheckSyncConfig):
 
-	def __init__(self, logger):
-		CheckSyncConfig.__init__(self, logger)
+	def __init__(self, repo, logger):
+		CheckSyncConfig.__init__(self, repo, logger)
 		self.checks.append('check_cvs_repo')
 
 


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/cvs/
@ 2015-01-18 18:04 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2015-01-18 18:04 UTC (permalink / raw
  To: gentoo-commits

commit:     a2a6d87d17d19d3ab9c64b829cdece7e2485f949
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sat Jan 17 17:35:17 2015 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jan 18 18:04:25 2015 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a2a6d87d

cvs sync: fix the module

Fix the cvs sync module since it doesn't work at all right now. More
specifically:

1. add exists() method that checks for the 'CVS' sub-directory to determine
whether the repository was checked out already.

2. Do not remove the just-created (in pre_sync()) directory on initial
clone, to avoid permission issues. Just run checkout on top of it.

3. Fix the sync method to run update unconditionally to whether the URI
starts with cvs:// or not. In fact, remove the whole check since it
doesn't serve any purpose.

---
 pym/portage/sync/modules/cvs/cvs.py | 36 ++++++++++++++----------------------
 1 file changed, 14 insertions(+), 22 deletions(-)

diff --git a/pym/portage/sync/modules/cvs/cvs.py b/pym/portage/sync/modules/cvs/cvs.py
index 2c3c6a3..919cb34 100644
--- a/pym/portage/sync/modules/cvs/cvs.py
+++ b/pym/portage/sync/modules/cvs/cvs.py
@@ -24,19 +24,15 @@ class CVSSync(SyncBase):
 		SyncBase.__init__(self, "cvs", portage.const.CVS_PACKAGE_ATOM)
 
 
+	def exists(self, **kwargs):
+		'''Tests whether the repo is checked out'''
+		return os.path.exists(os.path.join(self.repo.location, 'CVS'))
+
+
 	def new(self, **kwargs):
 		if kwargs:
 			self._kwargs(kwargs)
 		#initial checkout
-		try:
-			os.rmdir(self.repo.location)
-		except OSError as e:
-			if e.errno != errno.ENOENT:
-				msg = "!!! existing '%s' directory; exiting." % self.repo.location
-				self.logger(self.xterm_titles, msg)
-				writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR)
-				return (1, False)
-			del e
 		cvs_root = self.repo.sync_uri
 		if portage.process.spawn_bash(
 			"cd %s; exec cvs -z0 -d %s co -P -d %s %s" %
@@ -60,17 +56,13 @@ class CVSSync(SyncBase):
 		@rtype: (int, bool)
 		"""
 
-		cvs_root = self.repo.sync_uri
-
-		if cvs_root.startswith("cvs://"):
-			cvs_root = cvs_root[6:]
-			#cvs update
-			exitcode = portage.process.spawn_bash(
-				"cd %s; exec cvs -z0 -q update -dP" % \
-				(portage._shell_quote(self.repo.location),),
-				**portage._native_kwargs(self.spawn_kwargs))
-			if exitcode != os.EX_OK:
-				msg = "!!! cvs update error; exiting."
-				self.logger(self.xterm_titles, msg)
-				writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR)
+		#cvs update
+		exitcode = portage.process.spawn_bash(
+			"cd %s; exec cvs -z0 -q update -dP" % \
+			(portage._shell_quote(self.repo.location),),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! cvs update error; exiting."
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR)
 		return (exitcode, False)


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

* [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/cvs/
@ 2015-11-24  2:46 Arfrever Frehtes Taifersar Arahesis
  0 siblings, 0 replies; 3+ messages in thread
From: Arfrever Frehtes Taifersar Arahesis @ 2015-11-24  2:46 UTC (permalink / raw
  To: gentoo-commits

commit:     628aa100a480dfcb5fe0edeb1fcd6ea6f4b933a2
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever <AT> Apache <DOT> Org>
AuthorDate: Tue Nov 24 02:43:28 2015 +0000
Commit:     Arfrever Frehtes Taifersar Arahesis <arfrever <AT> apache <DOT> org>
CommitDate: Tue Nov 24 02:43:28 2015 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=628aa100

portage.sync.modules.cvs.CheckCVSConfig.check_cvs_repo(): Fix "KeyError: 'sync-cvs-repo'".

 pym/portage/sync/modules/cvs/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/pym/portage/sync/modules/cvs/__init__.py b/pym/portage/sync/modules/cvs/__init__.py
index 952053a..0cf6067 100644
--- a/pym/portage/sync/modules/cvs/__init__.py
+++ b/pym/portage/sync/modules/cvs/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2014 Gentoo Foundation
+# Copyright 2014-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 doc = """CVS plug-in module for portage.
@@ -18,7 +18,7 @@ class CheckCVSConfig(CheckSyncConfig):
 
 
 	def check_cvs_repo(self):
-		if self.repo.module_specific_options['sync-cvs-repo'] is None:
+		if self.repo.module_specific_options.get('sync-cvs-repo') is None:
 			writemsg_level("!!! %s\n" %
 				_("Repository '%s' has sync-type=cvs, but is missing sync-cvs-repo attribute")
 				% self.repo.name, level=self.logger.ERROR, noiselevel=-1)


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

end of thread, other threads:[~2015-11-24  2:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-06  4:45 [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/cvs/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2015-01-18 18:04 Michał Górny
2015-11-24  2:46 Arfrever Frehtes Taifersar Arahesis

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