From 23739a7fbedcadd3ba38af11d0f3146a8ef37061 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Mon, 4 Aug 2014 18:00:10 -0300 Subject: Fix build issue by not depending on ordering. --- src/luarocks/fetch.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/luarocks/fetch.lua b/src/luarocks/fetch.lua index 1d84b480..980c8fe2 100644 --- a/src/luarocks/fetch.lua +++ b/src/luarocks/fetch.lua @@ -111,9 +111,15 @@ function fetch.find_base_dir(file, temp_dir, src_url, src_dir) else util.printerr("Directory "..inferred_dir.." not found") local files = fs.list_dir() - if files[1] and fs.is_dir(files[1]) then - util.printerr("Found "..files[1]) - found_dir = files[1] + if files then + table.sort(files) + for i,filename in ipairs(files) do + if fs.is_dir(filename) then + util.printerr("Found "..filename) + found_dir = filename + break + end + end end end fs.pop_dir() -- cgit v1.2.3-55-g6feb