From 543595afc8707418150898e60d42b4c9e9e9621e Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sun, 2 Jun 2024 17:47:07 +0200 Subject: [PATCH 1/2] Add support for --help and -h with the setup scripts --- scripts/cvmfs/setup-nightlies.sh | 6 +++++- scripts/cvmfs/setup-releases.sh | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/cvmfs/setup-nightlies.sh b/scripts/cvmfs/setup-nightlies.sh index e9ea85d8..a65b3142 100644 --- a/scripts/cvmfs/setup-nightlies.sh +++ b/scripts/cvmfs/setup-nightlies.sh @@ -5,7 +5,7 @@ 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)" - echo " -h : print this help message" + echo " --help, -h : print this help message" echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution" echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution" } @@ -88,6 +88,10 @@ for ((i=1; i<=$#; i++)); do eval arg=\$$i eval "argn=\${$((i+1))}" case $arg in + --help|-h) + usage + return 0 + ;; --list-releases) if [ ! -n "$argn" ]; then list_release $os diff --git a/scripts/cvmfs/setup-releases.sh b/scripts/cvmfs/setup-releases.sh index a86d1147..01e99f35 100644 --- a/scripts/cvmfs/setup-releases.sh +++ b/scripts/cvmfs/setup-releases.sh @@ -1,11 +1,11 @@ #!/bin/bash -# This script sets up the Key4hep software stack from CVMFS for the nightlies +# This script sets up the Key4hep software stack from CVMFS for the stable releases function usage() { echo "Usage: source /cvmfs/sw.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)" - echo " -h : print this help message" + echo " --help, -h : print this help message" echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution" echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution" } @@ -99,6 +99,10 @@ for ((i=1; i<=$#; i++)); do eval arg=\$$i eval "argn=\${$((i+1))}" case $arg in + --help|-h) + usage + return 0 + ;; --list-releases) if [ ! -n "$argn" ]; then list_release $os From 0bc38b5ad47c18089180822eeac91cbec44fd0a2 Mon Sep 17 00:00:00 2001 From: jmcarcell Date: Sun, 2 Jun 2024 18:05:47 +0200 Subject: [PATCH 2/2] Add some comments about k4_local_repo --- scripts/cvmfs/setup-nightlies.sh | 2 ++ scripts/cvmfs/setup-releases.sh | 2 ++ 2 files changed, 4 insertions(+) diff --git a/scripts/cvmfs/setup-nightlies.sh b/scripts/cvmfs/setup-nightlies.sh index a65b3142..a27f43c3 100644 --- a/scripts/cvmfs/setup-nightlies.sh +++ b/scripts/cvmfs/setup-nightlies.sh @@ -8,6 +8,8 @@ function usage() { echo " --help, -h : print this help message" echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution" echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution" + echo "In addition, after sourcing, the command k4_local_repo can be used to add the current repository to the environment" + echo "It will delete all the existing paths containing the repository name and add some predefined paths to the environment" } function check_release() { diff --git a/scripts/cvmfs/setup-releases.sh b/scripts/cvmfs/setup-releases.sh index 01e99f35..cbbc2882 100644 --- a/scripts/cvmfs/setup-releases.sh +++ b/scripts/cvmfs/setup-releases.sh @@ -8,6 +8,8 @@ function usage() { echo " --help, -h : print this help message" echo " --list-releases [distribution] : list available releases for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the releases for the detected distribution" echo " --list-packages [distribution] : list available packages and their versions for the specified distribution (almalinux, centos, ubuntu). By default (no OS is specified) it will list the packages for the detected distribution" + echo "In addition, after sourcing, the command k4_local_repo can be used to add the current repository to the environment" + echo "It will delete all the existing paths containing the repository name and add some predefined paths to the environment" } function check_release() {