summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2011-08-22 09:28:40 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2013-12-16 13:39:17 +0000
commitf84256ff0317ca659d4ae13dfe4032769a903b11 (patch)
tree336a21706c73f35fcf42d43a79496b93735e2635
parent944590457f6d5ed0dbec1bc7923d317cfb639395 (diff)
downloadlua-aports-f84256ff0317ca659d4ae13dfe4032769a903b11.tar.bz2
lua-aports-f84256ff0317ca659d4ae13dfe4032769a903b11.tar.xz
aports.lua: implement foreach_aport()
-rwxr-xr-xaports.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/aports.lua b/aports.lua
index 87b4cf7..3f7e9ae 100755
--- a/aports.lua
+++ b/aports.lua
@@ -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