From 0f144cd1d7f39a6791209dd2ae8ff26e54a48168 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20Mr=C3=A1zek?= Date: Tue, 1 Jul 2025 12:41:50 +0200 Subject: [PATCH] Revert "scripts/poe-tasks/utils/_env.sh: added CONFIG_FILE_NAME variable" This reverts commit d3d4c2fbe52048ecd3df59e7e8e3d2017ad7914c. --- scripts/poe-tasks/utils/_env.sh | 136 ++++++++++++++++---------------- 1 file changed, 68 insertions(+), 68 deletions(-) diff --git a/scripts/poe-tasks/utils/_env.sh b/scripts/poe-tasks/utils/_env.sh index 586435443..30e07fc19 100644 --- a/scripts/poe-tasks/utils/_env.sh +++ b/scripts/poe-tasks/utils/_env.sh @@ -12,8 +12,8 @@ reset="\033[0m" # ensure consistent top level directory gitroot="$(git rev-parse --show-toplevel)" if test -z "$gitroot"; then - echo -e "${red}This command can be run only in a git repository tree.${reset}" - exit 1 + echo -e "${red}This command can be run only in a git repository tree.${reset}" + exit 1 fi cd $gitroot @@ -24,13 +24,13 @@ install_dev_dir="$gitroot/.install_dev" # ensure consistent environment with virtualenv if test -z "$VIRTUAL_ENV" -a "$CI" != "true" -a -z "$KNOT_ENV"; then - echo -e "${yellow}You are NOT running the script within the project's virtual environment.${reset}" - echo -e "Do you want to continue regardless? [yN]" - read cont - if test "$cont" != "y" -a "$cont" != "Y"; then - echo -e "${red}Exiting early...${reset}" - exit 1 - fi + echo -e "${yellow}You are NOT running the script within the project's virtual environment.${reset}" + echo -e "Do you want to continue regardless? [yN]" + read cont + if test "$cont" != "y" -a "$cont" != "Y"; then + echo -e "${red}Exiting early...${reset}" + exit 1 + fi fi # update PATH with node_modules @@ -44,87 +44,87 @@ set -o nounset # Set enviromental variables if not if [ -z "${KRES_DEV_INSTALL_DIR:-}" ]; then - KRES_DEV_INSTALL_DIR="$install_dev_dir" + KRES_DEV_INSTALL_DIR="$install_dev_dir" fi if [ -z "${KRES_DEV_CONFIG_FILE:-}" ]; then - KRES_DEV_CONFIG_FILE="$gitroot/etc/config/${CONFIG_FILE_NAME:-config.dev.yaml}" + KRES_DEV_CONFIG_FILE="$gitroot/etc/config/config.dev.yaml" fi export KRES_DEV_INSTALL_DIR export KRES_DEV_CONFIG_FILE function meson_setup_configure { - local reconfigure='' - if [ -d $build_dir ]; then - reconfigure='--reconfigure' - fi - echo --------------------------------------- - echo Configuring build directory using Meson - echo --------------------------------------- - meson setup \ - $build_dir \ - $reconfigure \ - --prefix=/usr \ - "$@" + local reconfigure='' + if [ -d $build_dir ]; then + reconfigure='--reconfigure' + fi + echo --------------------------------------- + echo Configuring build directory using Meson + echo --------------------------------------- + meson setup \ + $build_dir \ + $reconfigure \ + --prefix=/usr \ + "$@" } function meson_setup_configure_dev { - local reconfigure='' - if [ -d $build_dev_dir ]; then - reconfigure='--reconfigure' - fi - echo --------------------------------------- - echo Configuring build directory using Meson - echo --------------------------------------- - meson setup \ - $build_dev_dir \ - $reconfigure \ - --prefix=$KRES_DEV_INSTALL_DIR \ - -D user=$(id -un) \ - -D group=$(id -gn) \ - "$@" + local reconfigure='' + if [ -d $build_dev_dir ]; then + reconfigure='--reconfigure' + fi + echo --------------------------------------- + echo Configuring build directory using Meson + echo --------------------------------------- + meson setup \ + $build_dev_dir \ + $reconfigure \ + --prefix=$KRES_DEV_INSTALL_DIR \ + -D user=$(id -un) \ + -D group=$(id -gn) \ + "$@" } function is_build_dev_dir_configured { - if [ ! -d $build_dev_dir ]; then - echo - echo Knot Resolver build directory is not configured by Meson. - echo "Please run './poe configure' (optionally with additional Meson arguments)". - echo - exit 2 - fi + if [ ! -d $build_dev_dir ]; then + echo + echo Knot Resolver build directory is not configured by Meson. + echo "Please run './poe configure' (optionally with additional Meson arguments)". + echo + exit 2 + fi } function ninja_dev_install { - is_build_dev_dir_configured + is_build_dev_dir_configured - echo - echo -------------------------------------------- - echo Building/installing C komponents using Ninja - echo -------------------------------------------- - ninja -C $build_dev_dir - ninja install -C $build_dev_dir + echo + echo -------------------------------------------- + echo Building/installing C komponents using Ninja + echo -------------------------------------------- + ninja -C $build_dev_dir + ninja install -C $build_dev_dir } function check_rv { - if test "$1" -eq 0; then - echo -e " ${green}OK${reset}" - else - echo -e " ${red}FAIL${reset}" - fi - aggregated_rv=$(( $aggregated_rv + $1 )) + if test "$1" -eq 0; then + echo -e " ${green}OK${reset}" + else + echo -e " ${red}FAIL${reset}" + fi + aggregated_rv=$(( $aggregated_rv + $1 )) } function fancy_message { - if test "$aggregated_rv" -eq "0"; then - echo -e "${green}Everything looks great!${reset}" - else - echo -e "${red}Failure.${reset}" - echo -e "${red}These commands might help you:${reset}" - echo -e "${red}\tpoe format${reset}" - echo -e "${red}\tpoe gen-setuppy${reset}" - echo -e "${red}\tpoe gen-constantspy${reset}" - echo -e "${red}\tpoe gen-schema${reset}" - echo -e "${red}That's not great. Could you please fix that?${reset} 😲😟" - fi + if test "$aggregated_rv" -eq "0"; then + echo -e "${green}Everything looks great!${reset}" + else + echo -e "${red}Failure.${reset}" + echo -e "${red}These commands might help you:${reset}" + echo -e "${red}\tpoe format${reset}" + echo -e "${red}\tpoe gen-setuppy${reset}" + echo -e "${red}\tpoe gen-constantspy${reset}" + echo -e "${red}\tpoe gen-schema${reset}" + echo -e "${red}That's not great. Could you please fix that?${reset} 😲😟" + fi } -- 2.47.3