diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-30 13:10:06 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-03-30 13:11:13 +0200 |
commit | 486959e2dbd516f9d7bce8493a1a55b9d890066e (patch) | |
tree | 0233f3797d8bf79642fb81fea4f9c2b27d49f9d6 /ap.in | |
parent | dee681905fe6d164f86626fff9021982ab7bb0b1 (diff) | |
download | abuild-486959e2dbd516f9d7bce8493a1a55b9d890066e.tar.gz abuild-486959e2dbd516f9d7bce8493a1a55b9d890066e.tar.bz2 abuild-486959e2dbd516f9d7bce8493a1a55b9d890066e.tar.xz abuild-486959e2dbd516f9d7bce8493a1a55b9d890066e.zip |
ap/aports.lua: implement recurse_until
will recursively parse all build depends
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 |