diff options
author | Hisham Muhammad <hisham@gobolinux.org> | 2014-08-04 18:00:10 -0300 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2014-08-04 18:00:10 -0300 |
commit | 23739a7fbedcadd3ba38af11d0f3146a8ef37061 (patch) | |
tree | 555568af48a9074e081b5387dc7fa84422467118 | |
parent | 7374302cde00991cb0e9e0a7627a86985363049f (diff) | |
download | luarocks-23739a7fbedcadd3ba38af11d0f3146a8ef37061.tar.gz luarocks-23739a7fbedcadd3ba38af11d0f3146a8ef37061.tar.bz2 luarocks-23739a7fbedcadd3ba38af11d0f3146a8ef37061.zip |
Fix build issue by not depending on ordering.
-rw-r--r-- | src/luarocks/fetch.lua | 12 |
1 files 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) | |||
111 | else | 111 | else |
112 | util.printerr("Directory "..inferred_dir.." not found") | 112 | util.printerr("Directory "..inferred_dir.." not found") |
113 | local files = fs.list_dir() | 113 | local files = fs.list_dir() |
114 | if files[1] and fs.is_dir(files[1]) then | 114 | if files then |
115 | util.printerr("Found "..files[1]) | 115 | table.sort(files) |
116 | found_dir = files[1] | 116 | for i,filename in ipairs(files) do |
117 | if fs.is_dir(filename) then | ||
118 | util.printerr("Found "..filename) | ||
119 | found_dir = filename | ||
120 | break | ||
121 | end | ||
122 | end | ||
117 | end | 123 | end |
118 | end | 124 | end |
119 | fs.pop_dir() | 125 | fs.pop_dir() |