diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-24 20:15:53 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-08-24 20:15:53 +0200 |
commit | 85b54b355e416ccce6b34866bb3d7a5fa8f2bb5a (patch) | |
tree | 6c5a3647c9c6dba6d90c4a08941a97904344b239 /aports.lua | |
parent | fda6873c5a1c92363685d5dcc319d8e776a8f692 (diff) | |
download | abuild-85b54b355e416ccce6b34866bb3d7a5fa8f2bb5a.tar.bz2 abuild-85b54b355e416ccce6b34866bb3d7a5fa8f2bb5a.tar.xz |
aports.lua: implement get_maintainer()
So we can fish out the maintainer from given aport
Diffstat (limited to 'aports.lua')
-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 = {} |