diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/luarocks/index.lua | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/luarocks/index.lua b/src/luarocks/index.lua index 26266093..fa735592 100644 --- a/src/luarocks/index.lua +++ b/src/luarocks/index.lua | |||
@@ -95,13 +95,12 @@ function make_index(repo) | |||
95 | local latest_rockspec = nil | 95 | local latest_rockspec = nil |
96 | local output = index_package_start | 96 | local output = index_package_start |
97 | for version, data in util.sortedpairs(version_list, deps.compare_versions) do | 97 | for version, data in util.sortedpairs(version_list, deps.compare_versions) do |
98 | local out_versions = {} | 98 | local versions = {} |
99 | local arches = 0 | 99 | local versions_order = {} |
100 | output = output..version | 100 | output = output..version..': ' |
101 | local sep = ': ' | 101 | |
102 | for _, item in ipairs(data) do | 102 | for _, item in ipairs(data) do |
103 | output = output .. sep .. '<a href="$url">'..item.arch..'</a>' | 103 | local link = '<a href="$url">'..item.arch..'</a>' |
104 | sep = ', ' | ||
105 | if item.arch == 'rockspec' then | 104 | if item.arch == 'rockspec' then |
106 | local rs = ("%s-%s.rockspec"):format(package, version) | 105 | local rs = ("%s-%s.rockspec"):format(package, version) |
107 | if not latest_rockspec then latest_rockspec = rs end | 106 | if not latest_rockspec then latest_rockspec = rs end |
@@ -109,9 +108,14 @@ function make_index(repo) | |||
109 | else | 108 | else |
110 | output = output:gsub("$url", ("%s-%s.%s.rock"):format(package, version, item.arch)) | 109 | output = output:gsub("$url", ("%s-%s.%s.rock"):format(package, version, item.arch)) |
111 | end | 110 | end |
111 | versions[item.arch] = link | ||
112 | table.insert(versions_order, item.arch) | ||
112 | end | 113 | end |
113 | output = output .. '<br/>' | 114 | table.sort(versions_order) |
114 | output = output:gsub("$na", arches) | 115 | for i, arch in ipairs(versions_order) do |
116 | versions_order[i] = versions[versions_order[i]] | ||
117 | end | ||
118 | output = output .. table.concat(versions_order, ', ') .. '<br/>' | ||
115 | end | 119 | end |
116 | output = output .. index_package_end | 120 | output = output .. index_package_end |
117 | if latest_rockspec then | 121 | if latest_rockspec then |