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 0E5F513877A for ; Mon, 16 Jun 2014 22:45:23 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9077DE0CD8; Mon, 16 Jun 2014 22:45: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 605F3E0C3F for ; Mon, 16 Jun 2014 22:45:10 +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 6222B3400F6 for ; Mon, 16 Jun 2014 22:45:09 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by spoonbill.gentoo.org (Postfix) with ESMTP id 6940C188A2 for ; Mon, 16 Jun 2014 22:45: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: <1402958655.b96eaefa633548405a0389eaac66388ae2c1f870.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: b96eaefa633548405a0389eaac66388ae2c1f870 X-VCS-Branch: plugin-sync Date: Mon, 16 Jun 2014 22:45: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: 1cffaadb-8b76-4893-b7f7-abe20b53cf73 X-Archives-Hash: a91d362b6bbeca132cfed993b8499d1d commit: b96eaefa633548405a0389eaac66388ae2c1f870 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jun 16 17:58:09 2014 +0000 Commit: Brian Dolbec gmail com> CommitDate: Mon Jun 16 22:44:15 2014 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b96eaefa 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)