diff options
author | Geoff Leyland <geoff.leyland@incremental.co.nz> | 2015-12-23 21:54:34 +1300 |
---|---|---|
committer | Geoff Leyland <geoff.leyland@incremental.co.nz> | 2015-12-23 21:54:34 +1300 |
commit | 7590c40d647d130e9005f6efc10ab62f7e388e4b (patch) | |
tree | 01a440fd14d2bfa5fa1c5916f6e4baa4d2493500 /src | |
parent | e45f2a6bb460d0690722e862152a274ada15d300 (diff) | |
download | luarocks-7590c40d647d130e9005f6efc10ab62f7e388e4b.tar.gz luarocks-7590c40d647d130e9005f6efc10ab62f7e388e4b.tar.bz2 luarocks-7590c40d647d130e9005f6efc10ab62f7e388e4b.zip |
fetch.get_sources only searches the directory for the one true dir if the rockspec's source.dir was not set
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/fetch.lua | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index ef478658..039efeea 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua | |||
@@ -245,6 +245,7 @@ function fetch.load_local_rockspec(filename, quick) | |||
245 | rockspec.local_filename = filename | 245 | rockspec.local_filename = filename |
246 | local filebase = rockspec.source.file or rockspec.source.url | 246 | local filebase = rockspec.source.file or rockspec.source.url |
247 | local base = fetch.url_to_base_dir(filebase) | 247 | local base = fetch.url_to_base_dir(filebase) |
248 | rockspec.source.dir_set = rockspec.source.dir ~= nil | ||
248 | rockspec.source.dir = rockspec.source.dir | 249 | rockspec.source.dir = rockspec.source.dir |
249 | or rockspec.source.module | 250 | or rockspec.source.module |
250 | or ( (filebase:match("%.lua$") or filebase:match("%.c$")) | 251 | or ( (filebase:match("%.lua$") or filebase:match("%.c$")) |
@@ -356,14 +357,11 @@ function fetch.get_sources(rockspec, extract, dest_dir) | |||
356 | fs.unpack_archive(rockspec.source.file) | 357 | fs.unpack_archive(rockspec.source.file) |
357 | if not fs.exists(rockspec.source.dir) then | 358 | if not fs.exists(rockspec.source.dir) then |
358 | 359 | ||
359 | -- if rockspec.source.dir can't be found, see if we only have one | 360 | -- If rockspec.source.dir can't be found, see if we only have one |
360 | -- directory in store_dir. If that's the case, assume it's what | 361 | -- directory in store_dir. If that's the case, assume it's what |
361 | -- we're looking for. | 362 | -- we're looking for. |
362 | -- Ideally, we'd only do this if rockspec.source.dir was not | 363 | -- We only do this if the rockspec source.dir was not set, and only |
363 | -- defined in the rockspec, but load_local_repository already | 364 | -- with rockspecs newer than 3.0. |
364 | -- set it to an inferred value if it wasn't set there, so we | ||
365 | -- can't tell its status in the rockspec. | ||
366 | -- In any case, we only do this with rockspecs newer than 3.0. | ||
367 | local dir_count, found_dir = 0 | 365 | local dir_count, found_dir = 0 |
368 | 366 | ||
369 | if deps.format_is_at_least(rockspec, "3.0") then | 367 | if deps.format_is_at_least(rockspec, "3.0") then |