From 85b54b355e416ccce6b34866bb3d7a5fa8f2bb5a Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 24 Aug 2011 20:15:53 +0200 Subject: [PATCH] aports.lua: implement get_maintainer() So we can fish out the maintainer from given aport --- aports.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/aports.lua b/aports.lua index 3f7e9ae..e513a61 100755 --- a/aports.lua +++ b/aports.lua @@ -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 = {}