Gentoo Archives: gentoo-commits

From: Brian Dolbec <brian.dolbec@×××××.com>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/rsync/
Date: Sat, 08 Feb 2014 03:13:12
Message-Id: 1391828707.4f85bc1ebf00aef9f0cd499d2e3db36f5fb904bb.dol-sen@gentoo
1 commit: 4f85bc1ebf00aef9f0cd499d2e3db36f5fb904bb
2 Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
3 AuthorDate: Sat Feb 8 03:04:27 2014 +0000
4 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
5 CommitDate: Sat Feb 8 03:05:07 2014 +0000
6 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f85bc1e
7
8 Separate out the actual sync code to a private function.
9
10 Fix new() to return _sync().
11 Fix sync() to return new() or _sysnc().
12
13 ---
14 pym/portage/sync/modules/rsync/rsync.py | 17 ++++++++++-------
15 1 file changed, 10 insertions(+), 7 deletions(-)
16
17 diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py
18 index 12b4c9c..1c7abcc 100644
19 --- a/pym/portage/sync/modules/rsync/rsync.py
20 +++ b/pym/portage/sync/modules/rsync/rsync.py
21 @@ -56,14 +56,17 @@ class RsyncSync(object):
22 '''Rsync the repo'''
23 if kwargs:
24 self._kwargs(kwargs)
25 - myopts = self.options.get('emerge_config').opts
26 - spawn_kwargs = self.options.get('spawn_kwargs', None)
27 - usersync_uid = self.options.get('usersync_uid', None)
28
29 if not self.exists():
30 - if not self.new():
31 - return (1, False)
32 + return self.new()
33 + return self._sync()
34 +
35
36 + def _sync(self):
37 + '''Internal sync function which performs only the sync'''
38 + myopts = self.options.get('emerge_config').opts
39 + spawn_kwargs = self.options.get('spawn_kwargs', None)
40 + usersync_uid = self.options.get('usersync_uid', None)
41 enter_invalid = '--ask-enter-invalid' in myopts
42 out = portage.output.EOutput()
43 syncuri = self.repo.sync_uri
44 @@ -523,6 +526,6 @@ class RsyncSync(object):
45 self.logger(self.self.xterm_titles,
46 'Created New Directory %s ' % self.repo.location )
47 except IOError:
48 - return False
49 - return True
50 + return (1, False)
51 + return self._sync()