summaryrefslogtreecommitdiff
path: root/srcinfo.lua
diff options
context:
space:
mode:
Diffstat (limited to 'srcinfo.lua')
-rw-r--r--srcinfo.lua9
1 files changed, 8 insertions, 1 deletions
diff --git a/srcinfo.lua b/srcinfo.lua
index ef40cd9..855502a 100644
--- a/srcinfo.lua
+++ b/srcinfo.lua
@@ -6,8 +6,15 @@ local modes = {
[PKGBASE] = PKGBASE,
[PKGNAME] = PKGNAME,
}
+local package_mt = {}
+function package_mt:__index (key)
+ return self.base[key]
+end
+
+
+local
function apply (state, method, ...)
if state[method] then
return state[method](state, ...)
@@ -51,7 +58,7 @@ function srcinfo (text, options)
self.current = {name=value}
if self.mode == PKGNAME then
self.current.base = self.base
- return self.current
+ return setmetatable(self.current, package_mt)
else
table.insert(self.base.packages, self.current)
end