Skip to content

Commit

Permalink
Properly reset MARLIN_DLL for local packages (#569)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored Mar 14, 2024
1 parent 04d7c9c commit 0ba1044
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
15 changes: 14 additions & 1 deletion scripts/cvmfs/setup-nightlies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,19 @@ elif [ "$os" = "ubuntu22.04" ]; then
echo "Ubuntu 22.04 detected"
fi

_replace_marlin_dll() {
# replace the library on MARLIN_DLL with the local one (if any)
local pkg_name=${1}
local install_prefix=${2}
if echo ${MARLIN_DLL} | grep -qE "/${pkg_name}/"; then
local old_lib=$(echo ${MARLIN_DLL} | tr ":" "\n" | grep -E "/${pkg_name}/")
local lib_name=$(basename ${old_lib})
local new_lib=$(pwd)/${install_prefix}/lib/${lib_name}
export MARLIN_DLL=$(echo ${MARLIN_DLL%:} | tr ":" "\n" | grep -Ev "/${pkg_name}/" | tr "\n" ":")${new_lib}
echo "Replaced library on MARLIN_DLL: old: '${old_lib}'"
echo " new: '${new_lib}'"
fi
}

k4_local_repo() {
for arg in "$@"; do
Expand Down Expand Up @@ -168,7 +181,7 @@ k4_local_repo() {
export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export PKG_CONFIG_PATH=$(echo $PKG_CONFIG_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export ROOT_INCLUDE_PATH=$(echo $ROOT_INCLUDE_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export MARLIN_DLL=$(echo $MARLIN_DLL | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
_replace_marlin_dll ${current_repo} ${install}
export PATH=$PWD/$install/bin:$PATH
export LD_LIBRARY_PATH=$PWD/$install/lib:$PWD/$install/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=$PWD/$install/python:$PYTHONPATH
Expand Down
15 changes: 14 additions & 1 deletion scripts/cvmfs/setup-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,19 @@ elif [ "$os" = "ubuntu22.04" ]; then
echo "Ubuntu 22.04 detected"
fi

_replace_marlin_dll() {
# replace the library on MARLIN_DLL with the local one (if any)
local pkg_name=${1}
local install_prefix=${2}
if echo ${MARLIN_DLL} | grep -qE "/${pkg_name}/"; then
local old_lib=$(echo ${MARLIN_DLL} | tr ":" "\n" | grep -E "/${pkg_name}/")
local lib_name=$(basename ${old_lib})
local new_lib=$(pwd)/${install_prefix}/lib/${lib_name}
export MARLIN_DLL=$(echo ${MARLIN_DLL%:} | tr ":" "\n" | grep -Ev "/${pkg_name}/" | tr "\n" ":")${new_lib}
echo "Replaced library on MARLIN_DLL: old: '${old_lib}'"
echo " new: '${new_lib}'"
fi
}

k4_local_repo() {
for arg in "$@"; do
Expand Down Expand Up @@ -181,7 +194,7 @@ k4_local_repo() {
export CMAKE_PREFIX_PATH=$(echo $CMAKE_PREFIX_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export PKG_CONFIG_PATH=$(echo $PKG_CONFIG_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export ROOT_INCLUDE_PATH=$(echo $ROOT_INCLUDE_PATH | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
export MARLIN_DLL=$(echo $MARLIN_DLL | tr ":" "\n" | grep -Ev "/${current_repo}/" | tr "\n" ":")
_replace_marlin_dll ${current_repo} ${install}
export PATH=$PWD/$install/bin:$PATH
export LD_LIBRARY_PATH=$PWD/$install/lib:$PWD/$install/lib64:$LD_LIBRARY_PATH
export PYTHONPATH=$PWD/$install/python:$PYTHONPATH
Expand Down

0 comments on commit 0ba1044

Please sign in to comment.