diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/luarocks/fetch.lua | 7 |
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) | |||
| 170 | end | 170 | end |
| 171 | 171 | ||
| 172 | function fetch.url_to_base_dir(url) | 172 | function 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", "")) |
| 175 | end | 180 | end |
| 176 | 181 | ||
| 177 | --- Back-end function that actually loads the local rockspec. | 182 | --- Back-end function that actually loads the local rockspec. |
