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 88FC41387FF for ; Tue, 21 Oct 2014 05:05:14 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B1414E0877; Tue, 21 Oct 2014 05:05:12 +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 E9ECFE0874 for ; Tue, 21 Oct 2014 05:05:11 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EAD9A3404A6 for ; Tue, 21 Oct 2014 05:05:10 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 008C88613 for ; Tue, 21 Oct 2014 05:05:08 +0000 (UTC) From: "Zac Medico" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Zac Medico" Message-ID: <1413867847.8ba80d4cf6d4af4e6c1d59c3c0bf732ea224aea4.zmedico@gentoo> Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/svn/ X-VCS-Repository: proj/portage X-VCS-Files: pym/portage/sync/modules/svn/svn.py X-VCS-Directories: pym/portage/sync/modules/svn/ X-VCS-Committer: zmedico X-VCS-Committer-Name: Zac Medico X-VCS-Revision: 8ba80d4cf6d4af4e6c1d59c3c0bf732ea224aea4 X-VCS-Branch: plugin-sync Date: Tue, 21 Oct 2014 05:05:08 +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: 8d0b2065-93b2-4af8-8a20-063ac7d97510 X-Archives-Hash: 2a9a415d5a2986fe208a4630f68a7c86 commit: 8ba80d4cf6d4af4e6c1d59c3c0bf732ea224aea4 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 16 17:58:09 2014 +0000 Commit: Zac Medico gentoo org> CommitDate: Tue Oct 21 05:04:07 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=8ba80d4c sync/modules/svn: Add snv upgrade to sync operation This prevents errors when a newer svn has been installed that requires a db upgrade. --- pym/portage/sync/modules/svn/svn.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/pym/portage/sync/modules/svn/svn.py b/pym/portage/sync/modules/svn/svn.py index 182a7ac..0365e90 100644 --- a/pym/portage/sync/modules/svn/svn.py +++ b/pym/portage/sync/modules/svn/svn.py @@ -62,6 +62,10 @@ class SVNSync(SyncBase): @rtype: (int, bool) """ + exitcode, d = self._svn_upgrade() + if exitcode != os.EX_OK: + return (exitcode, False) + svn_root = self.repo.sync_uri if svn_root.startswith("svn://"): @@ -79,3 +83,22 @@ class SVNSync(SyncBase): self.logger(self.xterm_titles, msg) writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR) return (exitcode, False) + + + def _svn_upgrade(self): + """ + Internal function which performs an svn upgrade on the repo + + @return: tuple of return code (0=success), whether the cache + needs to be updated + @rtype: (int, bool) + """ + exitcode = portage.process.spawn_bash( + "cd %s; exec svn upgrade" % + (portage._shell_quote(self.repo.location),), + **portage._native_kwargs(self.spawn_kwargs)) + if exitcode != os.EX_OK: + msg = "!!! svn upgrade error; exiting." + self.logger(self.xterm_titles, msg) + writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR) + return (exitcode, False)