From f4d5e024a26937fef79b00779a9df7f75f36a4d0 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 14 May 2024 21:13:36 +0200 Subject: [PATCH] Update setup scripts to work when there are multiple links in latest --- scripts/cvmfs/setup-nightlies.sh | 6 +++--- scripts/cvmfs/setup-releases.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/cvmfs/setup-nightlies.sh b/scripts/cvmfs/setup-nightlies.sh index 8dc7c94c..4feeb376 100644 --- a/scripts/cvmfs/setup-nightlies.sh +++ b/scripts/cvmfs/setup-nightlies.sh @@ -62,16 +62,16 @@ fi if [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="centos"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = 'VERSION_ID="7"' ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rhel"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"7* ]]; then os="centos7" - k4path=$(echo /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*centos7*) + k4path=$(ls -rd /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*centos7* | head -n1) echo "WARNING: CentOS 7 nightlies are not being built anymore and will be deleted soon, consider using AlmaLinux 9" elif [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="almalinux"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rhel"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rocky"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]]; then os="almalinux9" - k4path=$(echo /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*almalinux9*) + k4path=$(ls -rd /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*almalinux9* | head -n1) elif [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID=ubuntu' && "$(grep -E 'VERSION_ID' /etc/os-release)" = 'VERSION_ID="22.04"' ]]; then os="ubuntu22.04" - k4path=$(echo /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*ubuntu22*) + k4path=$(ls -rd /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*ubuntu22* | head -n1) else echo "Unsupported OS or OS couldn't be correctly detected, aborting..." echo "Supported OSes are: CentOS/RHEL 7, AlmaLinux/RockyLinux/RHEL 9, Ubuntu 22.04" diff --git a/scripts/cvmfs/setup-releases.sh b/scripts/cvmfs/setup-releases.sh index a1ea4aec..7b438f29 100644 --- a/scripts/cvmfs/setup-releases.sh +++ b/scripts/cvmfs/setup-releases.sh @@ -63,15 +63,15 @@ fi if [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="centos"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = 'VERSION_ID="7"' ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rhel"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"7* ]]; then os="centos7" - k4path=$(echo /cvmfs/sw.hsf.org/key4hep/releases/$rel/*centos7*) + k4path=$(ls -rd /cvmfs/sw.hsf.org/key4hep/releases/$rel/*centos7* | head -n1) elif [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="almalinux"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rhel"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]] || [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID="rocky"' && "$(grep -E 'VERSION_ID' /etc/os-release)" = VERSION_ID=\"9* ]]; then os="almalinux9" - k4path=$(echo /cvmfs/sw.hsf.org/key4hep/releases/$rel/*almalinux9*) + k4path=$(ls -rd /cvmfs/sw.hsf.org/key4hep/releases/$rel/*almalinux9* | head -n1) elif [[ "$(grep -E '^ID=' /etc/os-release)" = 'ID=ubuntu' && "$(grep -E 'VERSION_ID' /etc/os-release)" = 'VERSION_ID="22.04"' ]]; then os="ubuntu22.04" - k4path=$(echo /cvmfs/sw.hsf.org/key4hep/releases/$rel/*ubuntu22*) + k4path=$(ls -rd /cvmfs/sw.hsf.org/key4hep/releases/$rel/*ubuntu22* | head -n1) else echo "Unsupported OS or OS couldn't be correctly detected, aborting..." echo "Supported OSes are: CentOS/RHEL 7, AlmaLinux/RockyLinux/RHEL 9, Ubuntu 22.04"