aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHisham Muhammad <hisham@gobolinux.org>2011-10-04 17:22:57 -0300
committerHisham Muhammad <hisham@gobolinux.org>2011-10-04 17:22:57 -0300
commit295c2940873e94c33e5f556284c7e9f3a1d296f5 (patch)
treef02574f23932725700d795c580458691b6fdb383
parente7672838ac65bb90f509fbf435f445b860fb4037 (diff)
downloadluarocks-2.0.6.tar.gz
luarocks-2.0.6.tar.bz2
luarocks-2.0.6.zip
Verify that file actually exists when using the 'file' protocol. Closes #47.v2.0.6
-rw-r--r--src/luarocks/fetch.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua
index c5983797..3f96e523 100644
--- a/src/luarocks/fetch.lua
+++ b/src/luarocks/fetch.lua
@@ -59,7 +59,11 @@ function fetch_url_at_temp_dir(url, tmpname, filename)
59 59
60 local protocol, pathname = dir.split_url(url) 60 local protocol, pathname = dir.split_url(url)
61 if protocol == "file" then 61 if protocol == "file" then
62 return pathname, dir.dir_name(fs.absolute_name(pathname)) 62 if fs.exists(pathname) then
63 return pathname, dir.dir_name(fs.absolute_name(pathname))
64 else
65 return nil, "File not found: "..pathname
66 end
63 else 67 else
64 local temp_dir = fs.make_temp_dir(tmpname) 68 local temp_dir = fs.make_temp_dir(tmpname)
65 if not temp_dir then 69 if not temp_dir then