diff options
Diffstat (limited to 'ap.in')
-rwxr-xr-x | ap.in | 26 |
1 files changed, 5 insertions, 21 deletions
@@ -36,28 +36,11 @@ subcmd.recursdeps = { desc = "Recursively print all make dependencies for given packages", usage = "PKG...", run = function (opts) - local i - local visited = {} - local apkdb, rev = aports.init_apkdb(repodirs) - function recurs(pn) - if pn == nil or visited[pn] or apkdb[pn] == nil then - return - end - visited[pn] = true - local i,d, p - for i,p in pairs(apkdb[pn]) do - local _, d - for _, d in pairs(p.depends) do - recurs(d) - end - for _, d in pairs(p.makedepends) do - recurs(d) - end - end - print(pn) - end + local db, rev = aports.init_apkdb(repodirs) for i = 2, #opts do - recurs(opts[i]) + aports.recurs_until(db, opts[i], function(pn) + print(pn) + end) end end } @@ -130,6 +113,7 @@ while i <= #arg do i = i + 1 end + cmd = opts[1] if cmd == nil then |