public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-02-19  7:53 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-02-19  7:53 UTC (permalink / raw
  To: gentoo-commits

commit:     6c779b4aeeb6a97b8b53d8c2998b13d86e84bb70
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 07:48:57 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Feb 19 07:48:57 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=6c779b4a

Initial rough-in of a websync module.

This module is capable of both a bash or python webrsync version selectable from an 
environemnt variable "TESTIT".  Later it can be converted to a portage/emerge setting
when the python version has been coded.

---
 pym/portage/sync/modules/websync/__init__.py |  50 ++++++++
 pym/portage/sync/modules/websync/websync.py  | 167 +++++++++++++++++++++++++++
 2 files changed, 217 insertions(+)

diff --git a/pym/portage/sync/modules/websync/__init__.py b/pym/portage/sync/modules/websync/__init__.py
new file mode 100644
index 0000000..22abf8c
--- /dev/null
+++ b/pym/portage/sync/modules/websync/__init__.py
@@ -0,0 +1,50 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+"""WebRSync plug-in module for portage.
+Performs a http download of a portage snapshot and verifies and
+ unpacks it to the repo location.
+"""
+
+import os
+
+DEFAULT_CLASS = "WebRsync"
+AVAILABLE_CLASSES = [ "WebRsync",  "PyWebsync"]
+options = {"1": "WebRsync", "2": "PyWebsync"}
+
+
+config_class = DEFAULT_CLASS
+try:
+	test_param = os.environ["TESTIT"]
+	if test_param in options:
+		config_class = options[test_param]
+except KeyError:
+	pass
+
+
+module_spec = {
+	'name': 'webrsync',
+	'description': __doc__,
+	'provides':{
+		'module1': {
+			'name': "websync",
+			'class': config_class,
+			'description': __doc__,
+			'functions': ['sync', 'new', 'exists'],
+			'func_desc': {
+				'sync': 'Performs a git pull on the repository',
+				'new': 'Creates the new repository at the specified location',
+				'exists': 'Returns a boolean of whether the specified dir ' +
+					'exists and is a valid Git repository',
+			},
+			'func_parameters': {
+				'kwargs': {
+					'type': dict,
+					'description': 'Standard python **kwargs parameter format' +
+						'Please refer to the sync modules specs at ' +
+						'"https://wiki.gentoo.org:Project:Portage" for details',
+				},
+			},
+		},
+	}
+}

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
new file mode 100644
index 0000000..5954a31
--- /dev/null
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -0,0 +1,167 @@
+
+'''WebRsync module for portage'''
+
+class WebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		self.has_git = True
+		if portage.process.find_binary("emerge-webrsync") is None:
+			msg = ["Command not found: git",
+			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
+			for l in msg:
+				writemsg_level("!!! %s\n" % l,
+					level=logging.ERROR, noiselevel=-1)
+			self.has_git = False
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass
+
+
+class PyWebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		#if portage.process.find_binary("gpg") is None:
+			#msg = ["Command not found: gpg",
+			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
+			#for l in msg:
+				#writemsg_level("!!! %s\n" % l,
+				#	level=logging.ERROR, noiselevel=-1)
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync/Clone the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-02-19  8:29 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-02-19  8:29 UTC (permalink / raw
  To: gentoo-commits

commit:     43f383e3594133b88a1f0870f864aa6180811469
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 08:24:58 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Feb 19 08:24:58 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=43f383e3

Use the new SyncBase class in websync module

---
 pym/portage/sync/modules/websync/websync.py | 112 ++--------------------------
 1 file changed, 6 insertions(+), 106 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 5954a31..7c31567 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,7 +1,9 @@
 
 '''WebRsync module for portage'''
 
-class WebRsync(object):
+from portage.sync.syncbase import SyncBase
+
+class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -11,60 +13,8 @@ class WebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		self.has_git = True
-		if portage.process.find_binary("emerge-webrsync") is None:
-			msg = ["Command not found: git",
-			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
-			for l in msg:
-				writemsg_level("!!! %s\n" % l,
-					level=logging.ERROR, noiselevel=-1)
-			self.has_git = False
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, 'emerge-webrsync', '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):
@@ -85,7 +35,7 @@ class WebRsync(object):
 		pass
 
 
-class PyWebRsync(object):
+class PyWebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -95,58 +45,8 @@ class PyWebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		#if portage.process.find_binary("gpg") is None:
-			#msg = ["Command not found: gpg",
-			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
-			#for l in msg:
-				#writemsg_level("!!! %s\n" % l,
-				#	level=logging.ERROR, noiselevel=-1)
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync/Clone the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, None, '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-05-02 23:13 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-05-02 23:13 UTC (permalink / raw
  To: gentoo-commits

commit:     d5bb53ece2bd74c60bbeff3b2f89b086bec2fa30
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 08:24:58 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri May  2 23:05:15 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d5bb53ec

Use the new SyncBase class in websync module

---
 pym/portage/sync/modules/websync/websync.py | 112 ++--------------------------
 1 file changed, 6 insertions(+), 106 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 5954a31..7c31567 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,7 +1,9 @@
 
 '''WebRsync module for portage'''
 
-class WebRsync(object):
+from portage.sync.syncbase import SyncBase
+
+class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -11,60 +13,8 @@ class WebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		self.has_git = True
-		if portage.process.find_binary("emerge-webrsync") is None:
-			msg = ["Command not found: git",
-			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
-			for l in msg:
-				writemsg_level("!!! %s\n" % l,
-					level=logging.ERROR, noiselevel=-1)
-			self.has_git = False
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, 'emerge-webrsync', '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):
@@ -85,7 +35,7 @@ class WebRsync(object):
 		pass
 
 
-class PyWebRsync(object):
+class PyWebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -95,58 +45,8 @@ class PyWebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		#if portage.process.find_binary("gpg") is None:
-			#msg = ["Command not found: gpg",
-			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
-			#for l in msg:
-				#writemsg_level("!!! %s\n" % l,
-				#	level=logging.ERROR, noiselevel=-1)
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync/Clone the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, None, '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-05-02 23:13 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-05-02 23:13 UTC (permalink / raw
  To: gentoo-commits

commit:     dd5d1b8227d6e29ca80964890fb264146347ae14
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 07:48:57 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Apr 30 07:38:46 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dd5d1b82

Initial rough-in of a websync module.

This module is capable of both a bash or python webrsync version selectable from an
environemnt variable "TESTIT".  Later it can be converted to a portage/emerge setting
when the python version has been coded.

---
 pym/portage/sync/modules/websync/__init__.py |  50 ++++++++
 pym/portage/sync/modules/websync/websync.py  | 167 +++++++++++++++++++++++++++
 2 files changed, 217 insertions(+)

diff --git a/pym/portage/sync/modules/websync/__init__.py b/pym/portage/sync/modules/websync/__init__.py
new file mode 100644
index 0000000..22abf8c
--- /dev/null
+++ b/pym/portage/sync/modules/websync/__init__.py
@@ -0,0 +1,50 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+"""WebRSync plug-in module for portage.
+Performs a http download of a portage snapshot and verifies and
+ unpacks it to the repo location.
+"""
+
+import os
+
+DEFAULT_CLASS = "WebRsync"
+AVAILABLE_CLASSES = [ "WebRsync",  "PyWebsync"]
+options = {"1": "WebRsync", "2": "PyWebsync"}
+
+
+config_class = DEFAULT_CLASS
+try:
+	test_param = os.environ["TESTIT"]
+	if test_param in options:
+		config_class = options[test_param]
+except KeyError:
+	pass
+
+
+module_spec = {
+	'name': 'webrsync',
+	'description': __doc__,
+	'provides':{
+		'module1': {
+			'name': "websync",
+			'class': config_class,
+			'description': __doc__,
+			'functions': ['sync', 'new', 'exists'],
+			'func_desc': {
+				'sync': 'Performs a git pull on the repository',
+				'new': 'Creates the new repository at the specified location',
+				'exists': 'Returns a boolean of whether the specified dir ' +
+					'exists and is a valid Git repository',
+			},
+			'func_parameters': {
+				'kwargs': {
+					'type': dict,
+					'description': 'Standard python **kwargs parameter format' +
+						'Please refer to the sync modules specs at ' +
+						'"https://wiki.gentoo.org:Project:Portage" for details',
+				},
+			},
+		},
+	}
+}

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
new file mode 100644
index 0000000..5954a31
--- /dev/null
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -0,0 +1,167 @@
+
+'''WebRsync module for portage'''
+
+class WebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		self.has_git = True
+		if portage.process.find_binary("emerge-webrsync") is None:
+			msg = ["Command not found: git",
+			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
+			for l in msg:
+				writemsg_level("!!! %s\n" % l,
+					level=logging.ERROR, noiselevel=-1)
+			self.has_git = False
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass
+
+
+class PyWebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		#if portage.process.find_binary("gpg") is None:
+			#msg = ["Command not found: gpg",
+			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
+			#for l in msg:
+				#writemsg_level("!!! %s\n" % l,
+				#	level=logging.ERROR, noiselevel=-1)
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync/Clone the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-05-02 23:13 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-05-02 23:13 UTC (permalink / raw
  To: gentoo-commits

commit:     9c795e7bc2a449c3a8ea2d45c464e6cb3b8ce6f9
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri May  2 23:12:38 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9c795e7b

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 37 +++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..e2afe1e 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,12 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
+
 
 	def post_sync(self, portdb, location, emerge_config):
 		'''repo.sync_type == "websync":
@@ -40,9 +69,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 15:18 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 15:18 UTC (permalink / raw
  To: gentoo-commits

commit:     b79794545eed4314d36091f9695de906295dfffe
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue May 13 04:17:42 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b7979454

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 15:46 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     5de2fac16cbb3e2cbe5823d89888b14fd9e1a665
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 08:24:58 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 15:36:55 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=5de2fac1

Use the new SyncBase class in websync module

---
 pym/portage/sync/modules/websync/websync.py | 112 ++--------------------------
 1 file changed, 6 insertions(+), 106 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 5954a31..7c31567 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,7 +1,9 @@
 
 '''WebRsync module for portage'''
 
-class WebRsync(object):
+from portage.sync.syncbase import SyncBase
+
+class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -11,60 +13,8 @@ class WebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		self.has_git = True
-		if portage.process.find_binary("emerge-webrsync") is None:
-			msg = ["Command not found: git",
-			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
-			for l in msg:
-				writemsg_level("!!! %s\n" % l,
-					level=logging.ERROR, noiselevel=-1)
-			self.has_git = False
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, 'emerge-webrsync', '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):
@@ -85,7 +35,7 @@ class WebRsync(object):
 		pass
 
 
-class PyWebRsync(object):
+class PyWebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -95,58 +45,8 @@ class PyWebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		#if portage.process.find_binary("gpg") is None:
-			#msg = ["Command not found: gpg",
-			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
-			#for l in msg:
-				#writemsg_level("!!! %s\n" % l,
-				#	level=logging.ERROR, noiselevel=-1)
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync/Clone the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, None, '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 15:46 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     4e4991ca9eec1165147d3826d65354658feecb9c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 07:48:57 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 15:36:55 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4e4991ca

Initial rough-in of a websync module.

This module is capable of both a bash or python webrsync version selectable from an
environemnt variable "TESTIT".  Later it can be converted to a portage/emerge setting
when the python version has been coded.

---
 pym/portage/sync/modules/websync/__init__.py |  50 ++++++++
 pym/portage/sync/modules/websync/websync.py  | 167 +++++++++++++++++++++++++++
 2 files changed, 217 insertions(+)

diff --git a/pym/portage/sync/modules/websync/__init__.py b/pym/portage/sync/modules/websync/__init__.py
new file mode 100644
index 0000000..22abf8c
--- /dev/null
+++ b/pym/portage/sync/modules/websync/__init__.py
@@ -0,0 +1,50 @@
+# Copyright 2014 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+"""WebRSync plug-in module for portage.
+Performs a http download of a portage snapshot and verifies and
+ unpacks it to the repo location.
+"""
+
+import os
+
+DEFAULT_CLASS = "WebRsync"
+AVAILABLE_CLASSES = [ "WebRsync",  "PyWebsync"]
+options = {"1": "WebRsync", "2": "PyWebsync"}
+
+
+config_class = DEFAULT_CLASS
+try:
+	test_param = os.environ["TESTIT"]
+	if test_param in options:
+		config_class = options[test_param]
+except KeyError:
+	pass
+
+
+module_spec = {
+	'name': 'webrsync',
+	'description': __doc__,
+	'provides':{
+		'module1': {
+			'name': "websync",
+			'class': config_class,
+			'description': __doc__,
+			'functions': ['sync', 'new', 'exists'],
+			'func_desc': {
+				'sync': 'Performs a git pull on the repository',
+				'new': 'Creates the new repository at the specified location',
+				'exists': 'Returns a boolean of whether the specified dir ' +
+					'exists and is a valid Git repository',
+			},
+			'func_parameters': {
+				'kwargs': {
+					'type': dict,
+					'description': 'Standard python **kwargs parameter format' +
+						'Please refer to the sync modules specs at ' +
+						'"https://wiki.gentoo.org:Project:Portage" for details',
+				},
+			},
+		},
+	}
+}

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
new file mode 100644
index 0000000..5954a31
--- /dev/null
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -0,0 +1,167 @@
+
+'''WebRsync module for portage'''
+
+class WebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		self.has_git = True
+		if portage.process.find_binary("emerge-webrsync") is None:
+			msg = ["Command not found: git",
+			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
+			for l in msg:
+				writemsg_level("!!! %s\n" % l,
+					level=logging.ERROR, noiselevel=-1)
+			self.has_git = False
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass
+
+
+class PyWebRsync(object):
+	'''WebRSync sync class'''
+
+	short_desc = "Perform sync operations on webrsync based repositories"
+
+	def name():
+		return "WebRSync"
+	name = staticmethod(name)
+
+
+	def can_progressbar(self, func):
+		return False
+
+
+	def __init__(self):
+		self.options = None
+		self.settings = None
+		self.logger = None
+		self.repo = None
+		self.xterm_titles = None
+
+		#if portage.process.find_binary("gpg") is None:
+			#msg = ["Command not found: gpg",
+			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
+			#for l in msg:
+				#writemsg_level("!!! %s\n" % l,
+				#	level=logging.ERROR, noiselevel=-1)
+
+
+	def _kwargs(self, kwargs):
+		'''Sets internal variables from kwargs'''
+		self.options = kwargs.get('options', {})
+		self.settings = self.options.get('settings', None)
+		self.logger = self.options.get('logger', None)
+		self.repo = self.options.get('repo', None)
+		self.xterm_titles = self.options.get('xterm_titles', False)
+
+
+	def exists(self, **kwargs):
+		'''Tests whether the repo actually exists'''
+		if kwargs:
+			self._kwargs(kwargs)
+		elif not self.repo:
+			return False
+		spawn_kwargs = self.options.get('spawn_kwargs', None)
+
+		if not os.path.exists(self.repo.location):
+			return False
+		return True
+
+
+	def sync(self, **kwargs):
+		'''Sync/Clone the repository'''
+		if kwargs:
+			self._kwargs(kwargs)
+
+		if not self.has_git:
+			return (1, False)
+
+		if not self.exists():
+			return self.new()
+		return self._sync()
+
+
+	def new(self, **kwargs):
+		'''Do the initial download and install of the repository'''
+		pass
+
+	def _sync(self):
+		''' Update existing repository
+		'''
+		pass
+
+	def post_sync(self, portdb, location, emerge_config):
+		'''repo.sync_type == "websync":
+		# NOTE: Do this after reloading the config, in case
+		# it did not exist prior to sync, so that the config
+		# and portdb properly account for its existence.
+		'''
+		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 15:46 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 15:46 UTC (permalink / raw
  To: gentoo-commits

commit:     67315af4a84ce00ff439beacd0d76170be452abd
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 15:36:57 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=67315af4

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 20:16 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 20:16 UTC (permalink / raw
  To: gentoo-commits

commit:     9eac55d260bb7a9d5ce8f908432a049faa9b9390
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 16 20:15:45 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 20:15:45 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9eac55d2

sync/modules/websync: Fix websync description

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

diff --git a/pym/portage/sync/modules/websync/__init__.py b/pym/portage/sync/modules/websync/__init__.py
index 7d1586a..e93ee10 100644
--- a/pym/portage/sync/modules/websync/__init__.py
+++ b/pym/portage/sync/modules/websync/__init__.py
@@ -35,10 +35,12 @@ module_spec = {
 			'description': __doc__,
 			'functions': ['sync', 'new', 'exists'],
 			'func_desc': {
-				'sync': 'Performs a git pull on the repository',
+				'sync': 'Performs an archived http download of the ' +
+					'repository, then unpacks it.  Optionally it performs a ' +
+					'gpg verification of the downloaded file(s)',
 				'new': 'Creates the new repository at the specified location',
 				'exists': 'Returns a boolean of whether the specified dir ' +
-					'exists and is a valid Git repository',
+					'exists and is a valid repository',
 			},
 			'validate_config': CheckSyncConfig,
 		},


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 22:45 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     c459ae02217af587d589fe564fead85838620994
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Wed Feb 19 08:24:58 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 22:41:59 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=c459ae02

Use the new SyncBase class in websync module

---
 pym/portage/sync/modules/websync/websync.py | 112 ++--------------------------
 1 file changed, 6 insertions(+), 106 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 5954a31..7c31567 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,7 +1,9 @@
 
 '''WebRsync module for portage'''
 
-class WebRsync(object):
+from portage.sync.syncbase import SyncBase
+
+class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -11,60 +13,8 @@ class WebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		self.has_git = True
-		if portage.process.find_binary("emerge-webrsync") is None:
-			msg = ["Command not found: git",
-			"Type \"emerge %s\" to enable git support." % portage.const.GIT_PACKAGE_ATOM]
-			for l in msg:
-				writemsg_level("!!! %s\n" % l,
-					level=logging.ERROR, noiselevel=-1)
-			self.has_git = False
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, 'emerge-webrsync', '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):
@@ -85,7 +35,7 @@ class WebRsync(object):
 		pass
 
 
-class PyWebRsync(object):
+class PyWebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
@@ -95,58 +45,8 @@ class PyWebRsync(object):
 	name = staticmethod(name)
 
 
-	def can_progressbar(self, func):
-		return False
-
-
 	def __init__(self):
-		self.options = None
-		self.settings = None
-		self.logger = None
-		self.repo = None
-		self.xterm_titles = None
-
-		#if portage.process.find_binary("gpg") is None:
-			#msg = ["Command not found: gpg",
-			#"Type \"emerge %s\" to enable blah support." % 'emerge-webrsync']
-			#for l in msg:
-				#writemsg_level("!!! %s\n" % l,
-				#	level=logging.ERROR, noiselevel=-1)
-
-
-	def _kwargs(self, kwargs):
-		'''Sets internal variables from kwargs'''
-		self.options = kwargs.get('options', {})
-		self.settings = self.options.get('settings', None)
-		self.logger = self.options.get('logger', None)
-		self.repo = self.options.get('repo', None)
-		self.xterm_titles = self.options.get('xterm_titles', False)
-
-
-	def exists(self, **kwargs):
-		'''Tests whether the repo actually exists'''
-		if kwargs:
-			self._kwargs(kwargs)
-		elif not self.repo:
-			return False
-		spawn_kwargs = self.options.get('spawn_kwargs', None)
-
-		if not os.path.exists(self.repo.location):
-			return False
-		return True
-
-
-	def sync(self, **kwargs):
-		'''Sync/Clone the repository'''
-		if kwargs:
-			self._kwargs(kwargs)
-
-		if not self.has_git:
-			return (1, False)
-
-		if not self.exists():
-			return self.new()
-		return self._sync()
+		SyncBase.__init__(self, None, '>=sys-apps/portage-2.3')
 
 
 	def new(self, **kwargs):


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-06-16 22:45 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-06-16 22:45 UTC (permalink / raw
  To: gentoo-commits

commit:     21aaff79929b2e4a8168594134377f9969fd49d7
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Jun 16 22:44:14 2014 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=21aaff79

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-03 23:36 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-03 23:36 UTC (permalink / raw
  To: gentoo-commits

commit:     b8eda2641d41340d343744beba2da1d85ec6350b
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Wed Sep  3 23:34:54 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b8eda264

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-04  1:18 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-04  1:18 UTC (permalink / raw
  To: gentoo-commits

commit:     303674173125a151136c2310f48cc6db04a39e5c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep  4 01:18:01 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=30367417

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-05  4:38 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-05  4:38 UTC (permalink / raw
  To: gentoo-commits

commit:     7432d8421f8b658b63f1de9922abd9dc1a1a5a21
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Sep  4 07:20:41 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=7432d842

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-05 21:15 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-05 21:15 UTC (permalink / raw
  To: gentoo-commits

commit:     970f10b3f92b708cd857b16297b5941d0363a19f
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Fri Sep  5 20:26:13 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=970f10b3

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-27  2:20 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-27  2:20 UTC (permalink / raw
  To: gentoo-commits

commit:     e65399a462ecd27e872d73149c5dffd626cebf1c
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Sat Sep 27 01:40:15 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=e65399a4

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-29 18:29 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-29 18:29 UTC (permalink / raw
  To: gentoo-commits

commit:     d57851fb08a8737247d41306b9ee8cbbfb28bde6
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Mon Sep 29 17:20:20 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d57851fb

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-09-30  0:46 Brian Dolbec
  0 siblings, 0 replies; 21+ messages in thread
From: Brian Dolbec @ 2014-09-30  0:46 UTC (permalink / raw
  To: gentoo-commits

commit:     a91cb5d028d11e0120d943bfa235435edb650077
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Tue Sep 30 00:42:25 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=a91cb5d0

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-10-20  3:54 Zac Medico
  0 siblings, 0 replies; 21+ messages in thread
From: Zac Medico @ 2014-10-20  3:54 UTC (permalink / raw
  To: gentoo-commits

commit:     fa3fa9a9e5463ea22f90c617664963ce17298f33
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Mon Oct 20 03:48:34 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=fa3fa9a9

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

* [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
@ 2014-10-21  5:05 Zac Medico
  0 siblings, 0 replies; 21+ messages in thread
From: Zac Medico @ 2014-10-21  5:05 UTC (permalink / raw
  To: gentoo-commits

commit:     8489d90169b65ffbac2f03e9b4b986654b6b5657
Author:     Brian Dolbec <dolsen <AT> gentoo <DOT> org>
AuthorDate: Fri May  2 22:59:23 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Oct 21 05:04:06 2014 +0000
URL:        http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8489d901

sync/modules/websync: Make the bash version operational

---
 pym/portage/sync/modules/websync/websync.py | 54 ++++++++++++++++++-----------
 1 file changed, 34 insertions(+), 20 deletions(-)

diff --git a/pym/portage/sync/modules/websync/websync.py b/pym/portage/sync/modules/websync/websync.py
index 7c31567..f08ae77 100644
--- a/pym/portage/sync/modules/websync/websync.py
+++ b/pym/portage/sync/modules/websync/websync.py
@@ -1,16 +1,26 @@
 
 '''WebRsync module for portage'''
 
+import logging
+
+import portage
+from portage import os
+from portage.util import writemsg_level
+from portage.output import create_color_func
+good = create_color_func("GOOD")
+bad = create_color_func("BAD")
+warn = create_color_func("WARN")
 from portage.sync.syncbase import SyncBase
 
+
 class WebRsync(SyncBase):
 	'''WebRSync sync class'''
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -19,20 +29,31 @@ class WebRsync(SyncBase):
 
 	def new(self, **kwargs):
 		'''Do the initial download and install of the repository'''
-		pass
+		return self._sync()
+
 
 	def _sync(self):
 		''' Update existing repository
 		'''
-		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass
+		emerge_config = self.options.get('emerge_config', None)
+		portdb = self.options.get('portdb', None)
+
+		msg = ">>> Starting emerge-webrsync for %s..." % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		exitcode = portage.process.spawn_bash("%s" % \
+			(self.bin_command),
+			**portage._native_kwargs(self.spawn_kwargs))
+		if exitcode != os.EX_OK:
+			msg = "!!! emerge-webrsync error in %s" % self.repo.location
+			self.logger(self.xterm_titles, msg)
+			writemsg_level(msg + "\n", level=logging.ERROR, noiselevel=-1)
+			return (exitcode, False)
+		msg = ">>> Emerge-webrsync successful: %s" % self.repo.location
+		self.logger(self.xterm_titles, msg)
+		writemsg_level(msg + "\n")
+		#return self.post_sync(portdb, self.repo.location, emerge_config)
+		return (exitcode, True)
 
 
 class PyWebRsync(SyncBase):
@@ -40,9 +61,9 @@ class PyWebRsync(SyncBase):
 
 	short_desc = "Perform sync operations on webrsync based repositories"
 
+	@staticmethod
 	def name():
 		return "WebRSync"
-	name = staticmethod(name)
 
 
 	def __init__(self):
@@ -53,15 +74,8 @@ class PyWebRsync(SyncBase):
 		'''Do the initial download and install of the repository'''
 		pass
 
+
 	def _sync(self):
 		''' Update existing repository
 		'''
 		pass
-
-	def post_sync(self, portdb, location, emerge_config):
-		'''repo.sync_type == "websync":
-		# NOTE: Do this after reloading the config, in case
-		# it did not exist prior to sync, so that the config
-		# and portdb properly account for its existence.
-		'''
-		pass


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

end of thread, other threads:[~2014-10-21  5:05 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 23:13 [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/ Brian Dolbec
  -- strict thread matches above, loose matches on Subject: below --
2014-10-21  5:05 Zac Medico
2014-10-20  3:54 Zac Medico
2014-09-30  0:46 Brian Dolbec
2014-09-29 18:29 Brian Dolbec
2014-09-27  2:20 Brian Dolbec
2014-09-05 21:15 Brian Dolbec
2014-09-05  4:38 Brian Dolbec
2014-09-04  1:18 Brian Dolbec
2014-09-03 23:36 Brian Dolbec
2014-06-16 22:45 Brian Dolbec
2014-06-16 22:45 Brian Dolbec
2014-06-16 20:16 Brian Dolbec
2014-06-16 15:46 Brian Dolbec
2014-06-16 15:46 Brian Dolbec
2014-06-16 15:46 Brian Dolbec
2014-06-16 15:18 Brian Dolbec
2014-05-02 23:13 Brian Dolbec
2014-05-02 23:13 Brian Dolbec
2014-02-19  8:29 Brian Dolbec
2014-02-19  7:53 Brian Dolbec

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