From a11d263faea5d35a517d053c1456c9918757b1ad Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Tue, 6 Jul 2021 23:09:15 -0700 Subject: [PATCH] make-{apache,lighttpd}-conf.sh: make sure var_getconfpath available In the same way that var_online_cpus has been made available early for processing of the config files, do the same for var_getconfpath. It's convenient to have the value available for scripts configuration. Signed-off-by: Kyle J. McKay --- make-apache-conf.sh | 8 ++++++-- make-lighttpd-conf.sh | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/make-apache-conf.sh b/make-apache-conf.sh index 42f00b9..5c9de5f 100755 --- a/make-apache-conf.sh +++ b/make-apache-conf.sh @@ -24,12 +24,16 @@ perl -I"$PWD" -M"$__girocco_conf" -MGirocco::Validator -- - apache.conf.in >apac use strict; use warnings; -BEGIN { # hack to make var_online_cpus available now +BEGIN { # hack to make var_online_cpus and var_getconfpath available now $INC{'Girocco/Config.pm'} = 1; require Girocco::Util; my $online_cpus = Girocco::Util::online_cpus(); defined($online_cpus) && $online_cpus >= 1 or $online_cpus = 1; - eval '$Girocco::Config::var_online_cpus = '.$online_cpus.';'; + eval '$Girocco::Config::var_online_cpus = $online_cpus;'; + require Girocco::Dumper; + my $getconfpath = Girocco::Dumper::GetConfPath(); + defined($getconfpath) && $getconfpath ne "" or $getconfpath = "/usr/bin:/bin"; + eval '$Girocco::Config::var_getconfpath = $getconfpath;'; } my $frombegin = '# ---- BEGIN LINES TO DUPLICATE ----'; diff --git a/make-lighttpd-conf.sh b/make-lighttpd-conf.sh index 26c261a..1ce854f 100755 --- a/make-lighttpd-conf.sh +++ b/make-lighttpd-conf.sh @@ -24,12 +24,16 @@ perl -I"$PWD" -M"$__girocco_conf" -MGirocco::Validator -- - lighttpd.conf.in >li use strict; use warnings; -BEGIN { # hack to make var_online_cpus available now +BEGIN { # hack to make var_online_cpus and var_getconfpath available now $INC{'Girocco/Config.pm'} = 1; require Girocco::Util; my $online_cpus = Girocco::Util::online_cpus(); defined($online_cpus) && $online_cpus >= 1 or $online_cpus = 1; - eval '$Girocco::Config::var_online_cpus = '.$online_cpus.';'; + eval '$Girocco::Config::var_online_cpus = $online_cpus;'; + require Girocco::Dumper; + my $getconfpath = Girocco::Dumper::GetConfPath(); + defined($getconfpath) && $getconfpath ne "" or $getconfpath = "/usr/bin:/bin"; + eval '$Girocco::Config::var_getconfpath = $getconfpath;'; } my $frombegin = '# ---- BEGIN LINES TO DUPLICATE ----'; -- 2.11.4.GIT