1 |
commit: 0f80a9bce939874c51a83a9fea63905bbfd47675 |
2 |
Author: Brian Dolbec <dolsen <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon Jun 16 17:58:09 2014 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Tue Sep 30 00:42:26 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=0f80a9bc |
7 |
|
8 |
sync/modules/svn: Add snv upgrade to sync operation |
9 |
|
10 |
This prevents errors when a newer svn has been installed that requires a db upgrade. |
11 |
|
12 |
--- |
13 |
pym/portage/sync/modules/svn/svn.py | 23 +++++++++++++++++++++++ |
14 |
1 file changed, 23 insertions(+) |
15 |
|
16 |
diff --git a/pym/portage/sync/modules/svn/svn.py b/pym/portage/sync/modules/svn/svn.py |
17 |
index 182a7ac..0365e90 100644 |
18 |
--- a/pym/portage/sync/modules/svn/svn.py |
19 |
+++ b/pym/portage/sync/modules/svn/svn.py |
20 |
@@ -62,6 +62,10 @@ class SVNSync(SyncBase): |
21 |
@rtype: (int, bool) |
22 |
""" |
23 |
|
24 |
+ exitcode, d = self._svn_upgrade() |
25 |
+ if exitcode != os.EX_OK: |
26 |
+ return (exitcode, False) |
27 |
+ |
28 |
svn_root = self.repo.sync_uri |
29 |
|
30 |
if svn_root.startswith("svn://"): |
31 |
@@ -79,3 +83,22 @@ class SVNSync(SyncBase): |
32 |
self.logger(self.xterm_titles, msg) |
33 |
writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR) |
34 |
return (exitcode, False) |
35 |
+ |
36 |
+ |
37 |
+ def _svn_upgrade(self): |
38 |
+ """ |
39 |
+ Internal function which performs an svn upgrade on the repo |
40 |
+ |
41 |
+ @return: tuple of return code (0=success), whether the cache |
42 |
+ needs to be updated |
43 |
+ @rtype: (int, bool) |
44 |
+ """ |
45 |
+ exitcode = portage.process.spawn_bash( |
46 |
+ "cd %s; exec svn upgrade" % |
47 |
+ (portage._shell_quote(self.repo.location),), |
48 |
+ **portage._native_kwargs(self.spawn_kwargs)) |
49 |
+ if exitcode != os.EX_OK: |
50 |
+ msg = "!!! svn upgrade error; exiting." |
51 |
+ self.logger(self.xterm_titles, msg) |
52 |
+ writemsg_level(msg + "\n", noiselevel=-1, level=logging.ERROR) |
53 |
+ return (exitcode, False) |