commit: dfb277c58f8b0d55c1b0c9884cd91f3204888b38
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct 22 10:59:32 2014 +0000
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com>
CommitDate: Thu Dec 4 19:56:35 2014 +0000
URL:
http://sources.gentoo.org/gitweb/?p=proj/portage.git;a=commit;h=dfb277c5
RsyncSync: support file:// sync-uri
This will be useful for unit tests that will sync from a local
file:// sync-uri.
---
pym/portage/sync/modules/rsync/rsync.py | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/pym/portage/sync/modules/rsync/rsync.py
b/pym/portage/sync/modules/rsync/rsync.py
index 76d83f2..74c10e7 100644
--- a/pym/portage/sync/modules/rsync/rsync.py
+++ b/pym/portage/sync/modules/rsync/rsync.py
@@ -66,6 +66,9 @@ class RsyncSync(SyncBase):
rsync_opts = self._validate_rsync_opts(rsync_opts,
syncuri)
self.rsync_opts = self._rsync_opts_extend(opts, rsync_opts)
+ self.extra_rsync_opts = portage.util.shlex_split(
+ self.settings.get("PORTAGE_RSYNC_EXTRA_OPTS",""))
+
# Real local timestamp file.
self.servertimestampfile = os.path.join(
self.repo.location, "metadata", "timestamp.chk")
@@ -93,6 +96,14 @@ class RsyncSync(SyncBase):
except:
maxretries = -1 #default number of retries
+ if syncuri.startswith("file://"):
+ self.proto = "file"
+ dosyncuri = syncuri[6:]
+ is_synced, exitcode = self._do_rsync(
+ dosyncuri, timestamp, opts)
+ self._process_exitcode(exitcode, dosyncuri, out, 1)
+ return (exitcode, exitcode == os.EX_OK)
+
retries=0
try:
self.proto, user_name, hostname, port = re.split(
@@ -116,8 +127,6 @@ class RsyncSync(SyncBase):
getaddrinfo_host = hostname[1:-1]
updatecache_flg=True
all_rsync_opts = set(self.rsync_opts)
- self.extra_rsync_opts = portage.util.shlex_split(
- self.settings.get("PORTAGE_RSYNC_EXTRA_OPTS",""))
all_rsync_opts.update(self.extra_rsync_opts)
family = socket.AF_UNSPEC