diff options
Diffstat (limited to 'ap.in')
-rwxr-xr-x | ap.in | 29 |
1 files changed, 14 insertions, 15 deletions
@@ -66,9 +66,8 @@ subcmd.builddirs = { desc = "Print the build dirs for given packages in build order", usage = "PKG...", run = function(opts) - local i, _ + local i, p, _ local visited = {} - local dir_visited = {} local apkdb, rev = aports.init_apkdb(repodirs) local to_print = {} function recursdir(pn) @@ -78,23 +77,23 @@ subcmd.builddirs = { visited[pn] = true local i, p for i,p in pairs(apkdb[pn]) do - if not dir_visited[p.dir] then - dir_visited[p.dir] = true - local _, d - for _, d in pairs(p.depends) do - recursdir(d) - end - for _, d in pairs(p.makedepends) do - recursdir(d) - end - if to_print[pn] then - print(p.dir) - end + local _, d + for _, d in pairs(p.depends) do + recursdir(d) + end + for _, d in pairs(p.makedepends) do + recursdir(d) + end + if to_print[p.dir] then + print(p.dir) + to_print[p.dir] = nil end end end for i = 2, #opts do - to_print[opts[i]] = true + for _,p in pairs(apkdb[opts[i]]) do + to_print[p.dir] = true + end end for i = 2, #opts do recursdir(opts[i]) |