From 8c94eea89c3fe5bf53090ba442baac7987c4a2a7 Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Thu, 1 Aug 2024 10:18:35 +0200 Subject: [PATCH] refactor: split var path --- src/usr/local/containerbase/utils/constants.sh | 2 +- src/usr/local/containerbase/utils/filesystem.sh | 7 ++++++- test/bash/util.sh | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/usr/local/containerbase/utils/constants.sh b/src/usr/local/containerbase/utils/constants.sh index f5f9d7ff58..26e55f8c48 100644 --- a/src/usr/local/containerbase/utils/constants.sh +++ b/src/usr/local/containerbase/utils/constants.sh @@ -29,7 +29,7 @@ export TEMP_DIR=/tmp # used to source helper from tools export CONTAINERBASE_DIR=/usr/local/containerbase -export TOOL_PREP_DIR=/var/lib/containerbase/tool.prep.d +export CONTAINERBASE_VAR_DIR=/var/lib/containerbase # Used to find matching tool downloads ARCHITECTURE=$(uname -p) diff --git a/src/usr/local/containerbase/utils/filesystem.sh b/src/usr/local/containerbase/utils/filesystem.sh index 7472453a66..d885abbcd4 100644 --- a/src/usr/local/containerbase/utils/filesystem.sh +++ b/src/usr/local/containerbase/utils/filesystem.sh @@ -174,9 +174,14 @@ function get_containerbase_path () { echo "${CONTAINERBASE_DIR}" } +# Gets the path to the var folder to persist prepared tools state +function get_containerbase_var_path () { + echo "${CONTAINERBASE_VAR_DIR}" +} + # Gets the path to the cache folder function get_tool_prep_path () { - echo "${TOOL_PREP_DIR}" + echo "$(get_containerbase_var_path)/tool.prep.d" } function set_tool_prep () { diff --git a/test/bash/util.sh b/test/bash/util.sh index 52017ba860..2d7152c861 100644 --- a/test/bash/util.sh +++ b/test/bash/util.sh @@ -10,7 +10,7 @@ export BIN_DIR="${TEST_ROOT_DIR}/bin" export LIB_DIR="${TEST_ROOT_DIR}/lib" export USER_HOME="${TEST_ROOT_DIR}/user" export ENV_FILE="${TEST_ROOT_DIR}/env" -export TOOL_PREP_DIR="${TEST_ROOT_DIR}/tool.prep.d" +export CONTAINERBASE_VAR_DIR="${TEST_ROOT_DIR}/var" # set default test user export TEST_ROOT_USER=1000