From: "Brian Dolbec" <brian.dolbec@gmail.com>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/
Date: Thu, 4 Sep 2014 01:18:37 +0000 (UTC) [thread overview]
Message-ID: <1409793481.303674173125a151136c2310f48cc6db04a39e5c.dol-sen@gentoo> (raw)
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
next reply other threads:[~2014-09-04 1:18 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-04 1:18 Brian Dolbec [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-10-21 5:05 [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/websync/ 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-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-05-02 23:13 Brian Dolbec
2014-02-19 8:29 Brian Dolbec
2014-02-19 7:53 Brian Dolbec
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1409793481.303674173125a151136c2310f48cc6db04a39e5c.dol-sen@gentoo \
--to=brian.dolbec@gmail.com \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox