diff options
-rw-r--r-- | src/luarocks/deps.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/luarocks/deps.lua b/src/luarocks/deps.lua index 5b02c68b..63803374 100644 --- a/src/luarocks/deps.lua +++ b/src/luarocks/deps.lua | |||
@@ -373,7 +373,7 @@ end | |||
373 | -- @param files The array of constructed names | 373 | -- @param files The array of constructed names |
374 | local function add_all_patterns(file, patterns, files) | 374 | local function add_all_patterns(file, patterns, files) |
375 | for _, pattern in ipairs(patterns) do | 375 | for _, pattern in ipairs(patterns) do |
376 | table.insert(files, (pattern:gsub("?", file))) | 376 | table.insert(files, {#files + 1, (pattern:gsub("?", file))}) |
377 | end | 377 | end |
378 | end | 378 | end |
379 | 379 | ||
@@ -425,7 +425,7 @@ local function add_patterns_for_file(files, file, patterns) | |||
425 | add_all_patterns(matched, patterns, files) | 425 | add_all_patterns(matched, patterns, files) |
426 | end | 426 | end |
427 | end | 427 | end |
428 | table.insert(files, file) | 428 | table.insert(files, {#files + 1, file}) |
429 | end | 429 | end |
430 | end | 430 | end |
431 | 431 | ||
@@ -460,16 +460,17 @@ local function check_external_dependency_at(prefix, name, ext_files, vars, dirs, | |||
460 | 460 | ||
461 | local found = false | 461 | local found = false |
462 | table.sort(files, function(a, b) | 462 | table.sort(files, function(a, b) |
463 | if (not a:match("%*")) and b:match("%*") then | 463 | if (not a[2]:match("%*")) and b[2]:match("%*") then |
464 | return true | 464 | return true |
465 | elseif a:match("%*") and (not b:match("%*")) then | 465 | elseif a[2]:match("%*") and (not b[2]:match("%*")) then |
466 | return false | 466 | return false |
467 | else | 467 | else |
468 | return a < b | 468 | return a[1] < b[1] |
469 | end | 469 | end |
470 | end) | 470 | end) |
471 | for _, f in ipairs(files) do | 471 | for _, fa in ipairs(files) do |
472 | 472 | ||
473 | f = fa[2] | ||
473 | -- small convenience hack | 474 | -- small convenience hack |
474 | if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then | 475 | if f:match("%.so$") or f:match("%.dylib$") or f:match("%.dll$") then |
475 | f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) | 476 | f = f:gsub("%.[^.]+$", "."..cfg.external_lib_extension) |