From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 0F989138CF0 for ; Sat, 8 Feb 2014 03:13:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B4D35E0CC7; Sat, 8 Feb 2014 03:13:10 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 2FE4AE0CC7 for ; Sat, 8 Feb 2014 03:13:09 +0000 (UTC) Received: from spoonbill.gentoo.org (spoonbill.gentoo.org [81.93.255.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 2D25333F9E1 for ; Sat, 8 Feb 2014 03:13:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id E330E18278 for ; Sat, 8 Feb 2014 03:13:07 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1391828707.4f85bc1ebf00aef9f0cd499d2e3db36f5fb904bb.dol-sen@gentoo> Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/rsync/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/sync/modules/rsync/rsync.py X-VCS-Directories: pym/portage/sync/modules/rsync/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 4f85bc1ebf00aef9f0cd499d2e3db36f5fb904bb X-VCS-Branch: plugin-sync Date: Sat, 8 Feb 2014 03:13:07 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: b90ac876-ef33-497d-bc0b-77d33c996983 X-Archives-Hash: 1d19e55843c74492a3d1dbf00fea6e7f commit: 4f85bc1ebf00aef9f0cd499d2e3db36f5fb904bb Author: Brian Dolbec gentoo org> AuthorDate: Sat Feb 8 03:04:27 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sat Feb 8 03:05:07 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=4f85bc1e Separate out the actual sync code to a private function. Fix new() to return _sync(). Fix sync() to return new() or _sysnc(). --- pym/portage/sync/modules/rsync/rsync.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pym/portage/sync/modules/rsync/rsync.py b/pym/portage/sync/modules/rsync/rsync.py index 12b4c9c..1c7abcc 100644 --- a/pym/portage/sync/modules/rsync/rsync.py +++ b/pym/portage/sync/modules/rsync/rsync.py @@ -56,14 +56,17 @@ class RsyncSync(object): '''Rsync the repo''' if kwargs: self._kwargs(kwargs) - myopts = self.options.get('emerge_config').opts - spawn_kwargs = self.options.get('spawn_kwargs', None) - usersync_uid = self.options.get('usersync_uid', None) if not self.exists(): - if not self.new(): - return (1, False) + return self.new() + return self._sync() + + def _sync(self): + '''Internal sync function which performs only the sync''' + myopts = self.options.get('emerge_config').opts + spawn_kwargs = self.options.get('spawn_kwargs', None) + usersync_uid = self.options.get('usersync_uid', None) enter_invalid = '--ask-enter-invalid' in myopts out = portage.output.EOutput() syncuri = self.repo.sync_uri @@ -523,6 +526,6 @@ class RsyncSync(object): self.logger(self.self.xterm_titles, 'Created New Directory %s ' % self.repo.location ) except IOError: - return False - return True + return (1, False) + return self._sync()