From 263bd7152d897b57cd7c4842285f384428e634d9 Mon Sep 17 00:00:00 2001 From: Gordon Hecker Date: Wed, 24 Mar 2010 09:29:59 +0100 Subject: [PATCH] transport: use rsync instead of curl to handle file:// urls Signed-off-by: Gordon Hecker --- Changelog | 1 + generic/transport.lua | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Changelog b/Changelog index ef17e06..f6aca05 100644 --- a/Changelog +++ b/Changelog @@ -1,4 +1,5 @@ NEXT: + * rsync is now used instead of curl to access local files * allow environment configuration in source and results configuration files diff --git a/generic/transport.lua b/generic/transport.lua index 6af13a4..450a9c6 100644 --- a/generic/transport.lua +++ b/generic/transport.lua @@ -55,8 +55,7 @@ function fetch_file(surl, location, destdir, destname) local tmpfile_path = e2lib.mktempfile(template) local tmpfile = e2lib.basename(tmpfile_path) -- fetch the file to the temporary directory - if u.transport == "file" or - u.transport == "http" or + if u.transport == "http" or u.transport == "https" then -- use special flags here local curlflags = "--create-dirs --silent --show-error --fail" @@ -66,6 +65,14 @@ function fetch_file(surl, location, destdir, destname) if not rc then return false, e:cat(re) end + elseif u.transport == "file" then + -- rsync "sourcefile" "destdir/destfile" + local args = string.format("'/%s/%s' '%s/%s'", + u.path, location, destdir, tmpfile) + rc, re = e2lib.rsync(args) + if not rc then + return false, e:cat(re) + end elseif u.transport == "rsync+ssh" then local user if u.user then -- 2.39.5