mirror of
https://gitlab.alpinelinux.org/alpine/abuild.git
synced 2024-12-23 07:22:53 +00:00
ap: let builddirs use aports.recurs_until()
This commit is contained in:
parent
486959e2db
commit
876e4f7a67
30
ap.in
30
ap.in
@ -51,35 +51,23 @@ subcmd.builddirs = {
|
||||
run = function(opts)
|
||||
local i, p, _
|
||||
local visited = {}
|
||||
local apkdb, rev = aports.init_apkdb(repodirs)
|
||||
local db, rev = aports.init_apkdb(repodirs)
|
||||
local to_print = {}
|
||||
function recursdir(pn)
|
||||
if pn == nil or visited[pn] or apkdb[pn] == nil then
|
||||
return
|
||||
for i = 2, #opts do
|
||||
for _,p in pairs(db[opts[i]]) do
|
||||
to_print[p.dir] = true
|
||||
end
|
||||
visited[pn] = true
|
||||
local i, p
|
||||
for i,p in pairs(apkdb[pn]) do
|
||||
local _, d
|
||||
for _, d in pairs(p.depends) do
|
||||
recursdir(d)
|
||||
end
|
||||
for _, d in pairs(p.makedepends) do
|
||||
recursdir(d)
|
||||
end
|
||||
for i = 2, #opts do
|
||||
aports.recurs_until(db, opts[i], function(pn)
|
||||
local j,p
|
||||
for j, p in pairs(db[pn]) do
|
||||
if to_print[p.dir] then
|
||||
print(p.dir)
|
||||
to_print[p.dir] = nil
|
||||
end
|
||||
end
|
||||
end
|
||||
for i = 2, #opts do
|
||||
for _,p in pairs(apkdb[opts[i]]) do
|
||||
to_print[p.dir] = true
|
||||
end
|
||||
end
|
||||
for i = 2, #opts do
|
||||
recursdir(opts[i])
|
||||
end)
|
||||
end
|
||||
end
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user