From 9f4191517d21f2c285ec23cb3277f3c07afcc2f9 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Tue, 21 May 2024 10:52:48 +0200 Subject: [PATCH] Use /usr/bin/ls --- scripts/cvmfs/setup-nightlies.sh | 37 ++++-------------------------- scripts/cvmfs/setup-releases.sh | 39 ++++---------------------------- 2 files changed, 10 insertions(+), 66 deletions(-) diff --git a/scripts/cvmfs/setup-nightlies.sh b/scripts/cvmfs/setup-nightlies.sh index 399ae362..e9ea85d8 100644 --- a/scripts/cvmfs/setup-nightlies.sh +++ b/scripts/cvmfs/setup-nightlies.sh @@ -2,13 +2,6 @@ # This script sets up the Key4hep software stack from CVMFS for the nightlies -# Disable alias expansion, we don't want users to change the commands -if [ -n "$ZSH_VERSION" ]; then - setopt no_aliases -elif [ -n "$BASH_VERSION" ]; then - shopt -u expand_aliases -fi - function usage() { echo "Usage: source /cvmfs/sw-nightlies.hsf.org/key4hep/setup.sh [-r ] [--list-releases [distribution]] [--list-packages [distribution]]" echo " -r : setup a specific release, if not specified the latest release will be used (also used for --list-packages)" @@ -18,7 +11,7 @@ function usage() { } function check_release() { -if [[ "$1" = "-r" && -n "$2" && (! -d "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$2" || -z "$(ls "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$2" | grep $3)") ]]; then +if [[ "$1" = "-r" && -n "$2" && (! -d "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$2" || -z "$(/usr/bin/ls "/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$2" | grep $3)") ]]; then echo "Release $2 not found, this is a list of the available releases:" find /cvmfs/sw-nightlies.hsf.org/key4hep/releases/ -maxdepth 2 -type d -name "*$3*" | \awk -F/ '{print $(NF-1)}' | sort @@ -61,14 +54,6 @@ function list_packages() { find /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*$name*/ -maxdepth 2 -mindepth 2 -not -path '*/\.*' -type d | awk -F/ '{if ($NF ~ /develop/) printf "%s develop", $(NF-1); else {split($(NF),arr,"-"); printf "%s ", $(NF-1); printf "%s", arr[1]; for (i=2; i] [--list-releases [distribution]] [--list-packages [distribution]]" echo " -r : setup a specific release, if not specified the latest release will be used (also used for --list-packages)" @@ -19,7 +11,7 @@ function usage() { } function check_release() { -if [[ "$1" = "-r" && -n "$2" && (! -d "/cvmfs/sw.hsf.org/key4hep/releases/$2" || -z "$(ls "/cvmfs/sw.hsf.org/key4hep/releases/$2" | grep $3)") ]]; then +if [[ "$1" = "-r" && -n "$2" && (! -d "/cvmfs/sw.hsf.org/key4hep/releases/$2" || -z "$(/usr/bin/ls "/cvmfs/sw.hsf.org/key4hep/releases/$2" | grep $3)") ]]; then echo "Release $2 not found, this is a list of the available releases:" find /cvmfs/sw.hsf.org/key4hep/releases/ -maxdepth 2 -type d -name "*$3*" | \awk -F/ '{print $(NF-1)}' | sort @@ -62,14 +54,6 @@ function list_packages() { find /cvmfs/sw.hsf.org/key4hep/releases/$rel/*$name*/ -maxdepth 2 -mindepth 2 -not -path '*/\.*' -type d | awk -F/ '{if ($NF ~ /develop/) printf "%s develop", $(NF-1); else {split($(NF),arr,"-"); printf "%s ", $(NF-1); printf "%s", arr[1]; for (i=2; i