commit:     b1d34a76a90edeb9839e3004ee2871b716e8965a
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 22 11:01:03 2014 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct 22 11:01:03 2014 +0000
URL:        
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=b1d34a76

GitSync: support file:// sync-uri

This will be useful for unit tests that will sync from a local
file:// sync-uri.

---
 pym/portage/sync/modules/git/git.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/pym/portage/sync/modules/git/git.py 
b/pym/portage/sync/modules/git/git.py
index 7c28139..35943dd 100644
--- a/pym/portage/sync/modules/git/git.py
+++ b/pym/portage/sync/modules/git/git.py
@@ -60,10 +60,13 @@ class GitSync(SyncBase):
                msg = ">>> Cloning git repository from upstream into %s..." % 
self.repo.location
                self.logger(self.xterm_titles, msg)
                writemsg_level(msg + "\n")
+               sync_uri = self.repo.sync_uri
+               if sync_uri.startswith("file://"):
+                       sync_uri = sync_uri[6:]
                exitcode = portage.process.spawn_bash("cd %s ; %s clone %s ." % 
\
                        (portage._shell_quote(self.repo.location),
                        self.bin_command,
-                       portage._shell_quote(self.repo.sync_uri)),
+                       portage._shell_quote(sync_uri)),
                        **portage._native_kwargs(self.spawn_kwargs))
                if exitcode != os.EX_OK:
                        msg = "!!! git clone error in %s" % self.repo.location

Reply via email to