]> git.e2factory.org Git - e2factory.git/commitdiff
transport: Fix wrong documentation for file_path()
authorTobias Ulmer <tu@emlix.com>
Fri, 6 Dec 2013 14:34:44 +0000 (15:34 +0100)
committerTobias Ulmer <tu@emlix.com>
Wed, 16 Nov 2016 14:41:17 +0000 (15:41 +0100)
Signed-off-by: Tobias Ulmer <tu@emlix.com>
generic/transport.lua

index c0fbb040a301f5f1d17d8b13f458a5ac0520ea3f..cf34665a182a05551d67846709c49bd61d096112 100644 (file)
@@ -385,22 +385,22 @@ function transport.push_file(sourcefile, durl, location, push_permissions, try_h
     return true, nil
 end
 
---- fetch a file from a server
--- @param surl url to the server
--- @param location location relative to the server url
--- @return true on success, false on error
--- @return nil, an error string on error
+--- Get file path to the specified location, if the file is locally accessable.
+-- It's the responsibilty of the caller to check whether the file exists.
+-- @param surl Url to the server.
+-- @param location Location relative to the server url.
+-- @return File path on success, false on error.
+-- @return Error string on failure.
 function transport.file_path(surl, location)
     local e = err.new("can't get path to file")
     local u, re = url.parse(surl)
     if not u then
-        return nil, e:cat(re)
+        return false, e:cat(re)
     end
     if u.transport ~= "file" then
-        return nil, e:append("transport does not support file_path()")
+        return false, e:append("transport does not support file_path()")
     end
-    local path = string.format("/%s/%s", u.path, location)
-    return path
+    return string.format("/%s/%s", u.path, location)
 end
 
 return strict.lock(transport)