diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2014-08-19 10:45:01 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2014-08-19 10:45:01 +0200 |
commit | 15d43dee37441b768cf401e692a861bfbe06ced8 (patch) | |
tree | c414fcdd59b42ec40ce61853d8f9a75bdd873f33 /aports | |
parent | c8b8b9848a1f46d7f6231cbf4a922f64c79157b7 (diff) | |
download | lua-aports-15d43dee37441b768cf401e692a861bfbe06ced8.tar.bz2 lua-aports-15d43dee37441b768cf401e692a861bfbe06ced8.tar.xz |
abuild: add function for getting the libc
use whatever the abuild functions.sh says it is
Diffstat (limited to 'aports')
-rw-r--r-- | aports/abuild.lua | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/aports/abuild.lua b/aports/abuild.lua index 50f0d3d..805bdb9 100644 --- a/aports/abuild.lua +++ b/aports/abuild.lua @@ -23,19 +23,29 @@ function M.get_conf(var) return abuild_conf[var] end -function M.get_arch() - if abuild_conf.CARCH then - return abuild_conf.CARCH +local function get_cached_var(var) + if abuild_conf[var] then + return abuild_conf[var] end - local f = io.popen(" . "..M.functions..' ; echo -n "$CARCH"') - abuild_conf.CARCH = f:read("*all") + local f = io.popen((' . %s ; echo -n "$%s"'):format(M.functions, var)) + abuild_conf[var] = f:read("*all") f:close() - return abuild_conf.CARCH + return abuild_conf[var] +end + +function M.get_arch() + return get_cached_var("CARCH") +end + +function M.get_libc() + return get_cached_var("CLIBC") end M.arch = M.get_arch() +M.libc = M.get_libc() M.repodest = M.get_conf("REPODEST") M.pkgdest = M.get_conf("PKGDEST") M.chost = M.get_conf("CHOST") + return M |