From 15d43dee37441b768cf401e692a861bfbe06ced8 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Tue, 19 Aug 2014 10:45:01 +0200 Subject: abuild: add function for getting the libc use whatever the abuild functions.sh says it is --- aports/abuild.lua | 22 ++++++++++++++++------ 1 file 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 -- cgit v1.2.3