From: "Brian Dolbec" <brian.dolbec@gmail.com> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/portage:master commit in: pym/portage/sync/modules/svn/ Date: Thu, 4 Dec 2014 20:16:10 +0000 (UTC) [thread overview] Message-ID: <1417722993.9831dd2fbd8889ee4c1738813b6a9c4c78c36e8c.dol-sen@gentoo> (raw) commit: 9831dd2fbd8889ee4c1738813b6a9c4c78c36e8c Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Mon Jun 16 17:58:09 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Thu Dec 4 19:56:33 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9831dd2f 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)
WARNING: multiple messages have this Message-ID (diff)
From: "Brian Dolbec" <brian.dolbec@gmail.com> To: gentoo-commits@lists.gentoo.org Subject: [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/svn/ Date: Thu, 4 Dec 2014 20:04:30 +0000 (UTC) [thread overview] Message-ID: <1417722993.9831dd2fbd8889ee4c1738813b6a9c4c78c36e8c.dol-sen@gentoo> (raw) Message-ID: <20141204200430.CjDoqs_on2oT2KQwwqQX44cBQsMjQvJ3Z7aIi9q-IhQ@z> (raw) commit: 9831dd2fbd8889ee4c1738813b6a9c4c78c36e8c Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> AuthorDate: Mon Jun 16 17:58:09 2014 +0000 Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> CommitDate: Thu Dec 4 19:56:33 2014 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=9831dd2f 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)
next reply other threads:[~2014-12-04 20:16 UTC|newest] Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top 2014-12-04 20:16 Brian Dolbec [this message] 2014-12-04 20:04 ` [gentoo-commits] proj/portage:plugin-sync commit in: pym/portage/sync/modules/svn/ Brian Dolbec -- strict thread matches above, loose matches on Subject: below -- 2015-01-18 18:04 [gentoo-commits] proj/portage:master " Michał Górny
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1417722993.9831dd2fbd8889ee4c1738813b6a9c4c78c36e8c.dol-sen@gentoo \ --to=brian.dolbec@gmail.com \ --cc=gentoo-commits@lists.gentoo.org \ --cc=gentoo-dev@lists.gentoo.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox