From 524c7521b054ea7217daf501f6c9062dc52b1dbf Mon Sep 17 00:00:00 2001 From: Gabriel Arazas Date: Sun, 23 Apr 2023 13:57:48 +0800 Subject: [PATCH] guile: cleanup setup hook --- .../interpreters/guile/setup-hook-1.8.sh | 2 +- .../interpreters/guile/setup-hook-2.0.sh | 12 ++++++------ .../interpreters/guile/setup-hook-2.2.sh | 12 ++++++------ .../interpreters/guile/setup-hook-3.0.sh | 18 +++++++++--------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/pkgs/development/interpreters/guile/setup-hook-1.8.sh b/pkgs/development/interpreters/guile/setup-hook-1.8.sh index 946e595ac0bf..9a6ffb793a78 100644 --- a/pkgs/development/interpreters/guile/setup-hook-1.8.sh +++ b/pkgs/development/interpreters/guile/setup-hook-1.8.sh @@ -1,6 +1,6 @@ addGuileLibPath () { if test -d "$1/share/guile/site"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site" fi } diff --git a/pkgs/development/interpreters/guile/setup-hook-2.0.sh b/pkgs/development/interpreters/guile/setup-hook-2.0.sh index d83f9c647057..9ef0fae011b5 100644 --- a/pkgs/development/interpreters/guile/setup-hook-2.0.sh +++ b/pkgs/development/interpreters/guile/setup-hook-2.0.sh @@ -1,18 +1,18 @@ addGuileLibPath () { if test -d "$1/share/guile/site/2.0"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.0" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.0" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/2.0" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/2.0" elif test -d "$1/share/guile/site"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site" fi if test -d "$1/lib/guile/2.0/ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.0/ccache" fi if test -d "$1/lib/guile/2.0/site-ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.0/site-ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.0/site-ccache" fi } diff --git a/pkgs/development/interpreters/guile/setup-hook-2.2.sh b/pkgs/development/interpreters/guile/setup-hook-2.2.sh index d6bb23e7949a..932a5b6c41e6 100644 --- a/pkgs/development/interpreters/guile/setup-hook-2.2.sh +++ b/pkgs/development/interpreters/guile/setup-hook-2.2.sh @@ -1,18 +1,18 @@ addGuileLibPath () { if test -d "$1/share/guile/site/2.2"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/2.2" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/2.2" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/2.2" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/2.2" elif test -d "$1/share/guile/site"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site" fi if test -d "$1/lib/guile/2.2/ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.2/ccache" fi if test -d "$1/lib/guile/2.2/site-ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/2.2/site-ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/2.2/site-ccache" fi } diff --git a/pkgs/development/interpreters/guile/setup-hook-3.0.sh b/pkgs/development/interpreters/guile/setup-hook-3.0.sh index 903a1ebfb235..1a71e82d13a2 100644 --- a/pkgs/development/interpreters/guile/setup-hook-3.0.sh +++ b/pkgs/development/interpreters/guile/setup-hook-3.0.sh @@ -1,24 +1,24 @@ addGuileLibPath () { if test -d "$1/share/guile/site/3.0"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site/3.0" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site/3.0" - export GUILE_EXTENSIONS_PATH="${GUILE_EXTENSIONS_PATH-}${GUILE_EXTENSIONS_PATH:+:}$1/share/guile/site/3.0" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site/3.0" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site/3.0" + addToSearchPath GUILE_EXTENSIONS_PATH "$1/share/guile/site/3.0" elif test -d "$1/share/guile/site"; then - export GUILE_LOAD_PATH="${GUILE_LOAD_PATH-}${GUILE_LOAD_PATH:+:}$1/share/guile/site" - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/share/guile/site" - export GUILE_EXTENSIONS_PATH="${GUILE_EXTENSIONS_PATH-}${GUILE_EXTENSIONS_PATH:+:}$1/share/guile/site" + addToSearchPath GUILE_LOAD_PATH "$1/share/guile/site" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/share/guile/site" + addToSearchPath GUILE_EXTENSIONS_PATH "$1/share/guile/site" fi if test -d "$1/lib/guile/3.0/ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/3.0/ccache" fi if test -d "$1/lib/guile/3.0/site-ccache"; then - export GUILE_LOAD_COMPILED_PATH="${GUILE_LOAD_COMPILED_PATH-}${GUILE_LOAD_COMPILED_PATH:+:}$1/lib/guile/3.0/site-ccache" + addToSearchPath GUILE_LOAD_COMPILED_PATH "$1/lib/guile/3.0/site-ccache" fi if test -d "$1/lib/guile/3.0/extensions"; then - export GUILE_EXTENSIONS_PATH="${GUILE_EXTENSIONS_PATH-}${GUILE_EXTENSIONS_PATH:+:}$1/lib/guile/3.0/extensions" + addToSearchPath GUILE_EXTENSIONS_PATH "$1/lib/guile/3.0/extensions" fi }