From 5f506cda11229ba06b1b50d3ba74fe9c0a421ca3 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 30 Nov 2020 01:10:19 -0700 Subject: [PATCH] shlib.sh: set var_online_cpus Use the preexisting $Girocco::Util::online_cpus function to export the result (or "1" if it cannot make a determination) as the `var_online_cpus` value. This can help automate some configuration processes and that function knows how to extract the value from more places than just using `getconf` with a non-POSIX value. Signed-off-by: Kyle J. McKay --- shlib.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shlib.sh b/shlib.sh index 351bfb1..5c9324e 100644 --- a/shlib.sh +++ b/shlib.sh @@ -102,6 +102,7 @@ get_girocco_config_var_list() ( # var_have_git_235 Set to 1 if git version >= 2.3.5 otherwise '' # var_have_git_260 Set to 1 if git version >= 2.6.0 otherwise '' # var_have_git_2101 Set to 1 if git version >= 2.10.1 otherwise '' + # var_online_cpus Girocco::Util::online_cpus or 1 if that fails # var_window_memory Value to use for repack --window-memory= # var_big_file_threshold Value to use for core.bigFileThreshold # var_redelta_threshold Recompute deltas if no more than this many objs @@ -150,6 +151,9 @@ get_girocco_config_var_list() ( [ -z "$basedir" ] || __girocco_extrainc="-I$basedir" inc_basedir=@basedir@ [ "@basedir@" != '@'basedir'@' ] || inc_basedir="$PWD" + var_online_cpus="$(perl -I"$inc_basedir" $__girocco_extrainc -M$__girocco_conf \ + -MGirocco::Util -e 'print online_cpus')" || : + printf "var_online_cpus=%s\n" "${var_online_cpus:=1}" printf "var_window_memory=%s\n" \ "$(perl -I"$inc_basedir" $__girocco_extrainc -M$__girocco_conf \ -MGirocco::Util -e 'print calc_windowmemory')" -- 2.11.4.GIT