aports.lua: implement foreach_aport()

This commit is contained in:
Natanael Copa 2011-08-22 09:28:40 +00:00
parent 0b605e179e
commit fda6873c5a
1 changed files with 10 additions and 0 deletions

View File

@ -207,6 +207,16 @@ function Aports:foreach_pkg(pkg, f)
end
end
function Aports:foreach_aport(f)
self:foreach(function(pkgname)
self:foreach_pkg(pkgname, function(i, pkg)
if pkgname == pkg.pkgname then
f(pkg)
end
end)
end)
end
function new(repodirs)
local h = Aports
h.repodirs = repodirs