1 |
commit: 883f7ceb8b30f75d882e94074a3a3411875f6c31 |
2 |
Author: Zac Medico <zmedico <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Oct 22 11:01:03 2014 +0000 |
4 |
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon Dec 1 21:49:42 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=883f7ceb |
7 |
|
8 |
GitSync: support file:// sync-uri |
9 |
|
10 |
This will be useful for unit tests that will sync from a local |
11 |
file:// sync-uri. |
12 |
|
13 |
--- |
14 |
pym/portage/sync/modules/git/git.py | 5 ++++- |
15 |
1 file changed, 4 insertions(+), 1 deletion(-) |
16 |
|
17 |
diff --git a/pym/portage/sync/modules/git/git.py b/pym/portage/sync/modules/git/git.py |
18 |
index 7c28139..35943dd 100644 |
19 |
--- a/pym/portage/sync/modules/git/git.py |
20 |
+++ b/pym/portage/sync/modules/git/git.py |
21 |
@@ -60,10 +60,13 @@ class GitSync(SyncBase): |
22 |
msg = ">>> Cloning git repository from upstream into %s..." % self.repo.location |
23 |
self.logger(self.xterm_titles, msg) |
24 |
writemsg_level(msg + "\n") |
25 |
+ sync_uri = self.repo.sync_uri |
26 |
+ if sync_uri.startswith("file://"): |
27 |
+ sync_uri = sync_uri[6:] |
28 |
exitcode = portage.process.spawn_bash("cd %s ; %s clone %s ." % \ |
29 |
(portage._shell_quote(self.repo.location), |
30 |
self.bin_command, |
31 |
- portage._shell_quote(self.repo.sync_uri)), |
32 |
+ portage._shell_quote(sync_uri)), |
33 |
**portage._native_kwargs(self.spawn_kwargs)) |
34 |
if exitcode != os.EX_OK: |
35 |
msg = "!!! git clone error in %s" % self.repo.location |