aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThijs Schreijer <thijs@thijsschreijer.nl>2015-07-01 23:14:34 +0200
committerThijs Schreijer <thijs@thijsschreijer.nl>2015-07-01 23:14:34 +0200
commit6ca144cee96ef45d6a203455b236e4077dd37a03 (patch)
tree54b21f2b46291f64dfca4c9ae36928819053a693 /src
parent642be5cee59a20654226466f6f865e230c326751 (diff)
parent634ff0af63a250859863cee25b8ab21e2404a267 (diff)
downloadluarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.tar.gz
luarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.tar.bz2
luarocks-6ca144cee96ef45d6a203455b236e4077dd37a03.zip
Merge branch 'master' of github.com:keplerproject/luarocks into pref_versioned
Conflicts: src/luarocks/cfg.lua
Diffstat (limited to 'src')
-rw-r--r--src/luarocks/fetch.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua
index 686aadcd..e92aeddf 100644
--- a/src/luarocks/fetch.lua
+++ b/src/luarocks/fetch.lua
@@ -170,8 +170,13 @@ function fetch.fetch_and_unpack_rock(rock_file, dest)
170end 170end
171 171
172function fetch.url_to_base_dir(url) 172function fetch.url_to_base_dir(url)
173 -- for extensions like foo.tar.gz, "gz" is stripped first
174 local known_exts = {}
175 for _, ext in ipairs{"zip", "git", "tgz", "tar", "gz", "bz2"} do
176 known_exts[ext] = ""
177 end
173 local base = dir.base_name(url) 178 local base = dir.base_name(url)
174 return base:gsub("%.[^.]*$", ""):gsub("%.tar$", "") 179 return (base:gsub("%.([^.]*)$", known_exts):gsub("%.tar", ""))
175end 180end
176 181
177--- Back-end function that actually loads the local rockspec. 182--- Back-end function that actually loads the local rockspec.