summaryrefslogtreecommitdiffstats
path: root/ap.in
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-12-13 14:51:29 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-12-13 14:51:29 +0000
commit1a1199b9ec509745a69eec147ea7b0fb3441894b (patch)
treee89888bada1cd65a49e54651472068a9d79e62df /ap.in
parentce0e95607d04e95b0d07a11aacbaaa4dae26bfd7 (diff)
downloadabuild-1a1199b9ec509745a69eec147ea7b0fb3441894b.tar.bz2
abuild-1a1199b9ec509745a69eec147ea7b0fb3441894b.tar.xz
ap: bugfix in builddirs
Diffstat (limited to 'ap.in')
-rwxr-xr-xap.in29
1 files changed, 14 insertions, 15 deletions
diff --git a/ap.in b/ap.in
index 64b7cf9..32e2fc4 100755
--- a/ap.in
+++ b/ap.in
@@ -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])