summaryrefslogtreecommitdiffstats
path: root/aports
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2014-01-28 13:47:30 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2014-01-28 13:47:30 +0000
commit1522b9bebfbec8ffe9533c84a2e5717c76b74d5d (patch)
tree9800c9c96efa3fe5a227484c2546cec8de213b72 /aports
parented504fff5da1eeaa69398ca2806494fd7b864227 (diff)
downloadlua-aports-1522b9bebfbec8ffe9533c84a2e5717c76b74d5d.tar.bz2
lua-aports-1522b9bebfbec8ffe9533c84a2e5717c76b74d5d.tar.xz
pkg: add libc_enabled() and enabled()
This lets us check if a package is disabled in either arch or !libc_* in options
Diffstat (limited to 'aports')
-rw-r--r--aports/pkg.lua9
1 files changed, 9 insertions, 0 deletions
diff --git a/aports/pkg.lua b/aports/pkg.lua
index b5218e0..66f94cc 100644
--- a/aports/pkg.lua
+++ b/aports/pkg.lua
@@ -90,6 +90,15 @@ function M.arch_enabled(pkg)
return pkg.arch.all or pkg.arch.noarch or pkg.arch[abuild.arch]
end
+function M.libc_enabled(pkg)
+ local libc = abuild.chost:match("-([%a]+)$")
+ return not pkg.options["!libc_"..libc]
+end
+
+function M.enabled(pkg)
+ return pkg:arch_enabled() and pkg:libc_enabled()
+end
+
function M.each_dependency(pkg)
return coroutine.wrap(function()
for _,dep in pairs(pkg.depends or {}) do