summaryrefslogtreecommitdiff
path: root/ap.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-03-30 13:10:06 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2011-03-30 13:11:13 +0200
commit486959e2dbd516f9d7bce8493a1a55b9d890066e (patch)
tree0233f3797d8bf79642fb81fea4f9c2b27d49f9d6 /ap.in
parentdee681905fe6d164f86626fff9021982ab7bb0b1 (diff)
downloadabuild-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-xap.in26
1 files changed, 5 insertions, 21 deletions
diff --git a/ap.in b/ap.in
index 3d5925b..b0b973e 100755
--- a/ap.in
+++ b/ap.in
@@ -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