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 4A9821393DD for ; Fri, 5 Sep 2014 04:38:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 553E0E09B6; Fri, 5 Sep 2014 04:38:24 +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 69A4BE09A7 for ; Fri, 5 Sep 2014 04:38:23 +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 2FF6B340100 for ; Fri, 5 Sep 2014 04:38:22 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 98F364C09 for ; Fri, 5 Sep 2014 04:38:19 +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: <1409815242.d2a6895c1ecabb94b5e19df12d1ee3570cf56bce.dol-sen@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: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: d2a6895c1ecabb94b5e19df12d1ee3570cf56bce X-VCS-Branch: plugin-sync Date: Fri, 5 Sep 2014 04:38:19 +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: 2cd2a99f-4b1c-4735-b527-54f23dac65fd X-Archives-Hash: a4cdb52df1ced908f28b5a2e6ccf2071 commit: d2a6895c1ecabb94b5e19df12d1ee3570cf56bce Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 16 17:58:09 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Thu Sep 4 07:20:42 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=d2a6895c 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)