diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-24 20:15:53 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2013-12-16 13:39:17 +0000 |
commit | 8974fe1f0220daf7c4da264bdd27e2436f375bfb (patch) | |
tree | 2680b39b322fba0db8f8f939fb3f4bf6493a1151 | |
parent | f84256ff0317ca659d4ae13dfe4032769a903b11 (diff) | |
download | lua-aports-8974fe1f0220daf7c4da264bdd27e2436f375bfb.tar.bz2 lua-aports-8974fe1f0220daf7c4da264bdd27e2436f375bfb.tar.xz |
aports.lua: implement get_maintainer()
So we can fish out the maintainer from given aport
-rwxr-xr-x | aports.lua | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -121,6 +121,26 @@ function foreach_remote_source(p, func) end end +function get_maintainer(pkg) + if pkg == nil or pkg.dir == nil then + return nil + end + local f = io.open(pkg.dir.."/APKBUILD") + if f == nil then + return nil + end + local line + for line in f:lines() do + local maintainer = line:match("^%s*#%s*Maintainer:%s*(.*)") + if maintainer then + f:close() + return maintainer + end + end + f:close() + return nil +end + local function init_apkdb(repodirs) local pkgdb = {} local revdeps = {} |