Skip to content

Commit

Permalink
Make a few fixes to the setup scripts and to the script that deletes
Browse files Browse the repository at this point in the history
unused specs.
  • Loading branch information
jmcarcell committed Oct 8, 2024
1 parent 3b5efe5 commit 3419dac
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion scripts/cvmfs/setup-nightlies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function list_packages() {

# Define an array containing the paths to the folders
folders=("$latest_previous_release")
if [ $build_type = "dbg" ] && [ -d $(echo $latest_previous_release | sed 's/opt/dbg/') ]; then
if [ "$build_type" = "dbg" ] && [ -d $(echo $latest_previous_release | sed 's/opt/dbg/') ]; then
folders+=($(echo $latest_previous_release | sed 's/opt/dbg/'))
fi
folders+=(/cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*$name*$compiler*-*$build_type*)
Expand Down
7 changes: 6 additions & 1 deletion scripts/cvmfs/setup-releases.sh
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ if [[ "$1" = "-r" && -n "$2" ]]; then
rel="$2"
fi

# Build types are supported only after 2024-10-03
if [[ ! "$rel" == "latest"* ]] && [[ "$rel" < "2024-10-03" ]]; then
build_type=""
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"
Expand Down Expand Up @@ -259,7 +264,7 @@ for ((i=1; i<=$#; i++)); do
esac
done

k4path=$(/usr/bin/ls -rd /cvmfs/sw-nightlies.hsf.org/key4hep/releases/$rel/*$os*$compiler*$build_type | head -n1)
k4path=$(/usr/bin/ls -rd /cvmfs/sw.hsf.org/key4hep/releases/$rel/*$os*$compiler*$build_type | head -n1)

if [ -n "$KEY4HEP_STACK" ]; then
echo "The Key4hep software stack is already set up, please start a new shell to avoid conflicts"
Expand Down
4 changes: 2 additions & 2 deletions scripts/delete-unused.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This will delete unused (from example from a previous failed installation) specs that
# are no longer in the current installation
spack python -c 'from spack.cmd import uninstall; uninstall.do_uninstall([x for x in spack.store.STORE.db.query_local() if not any(x.satisfies(y) for y in spack.environment.active_environment().all_specs_generator())], False)'
spack -e . python -c 'from spack.cmd import uninstall; uninstall.do_uninstall([x for x in spack.store.STORE.db.query_local() if not any(x.satisfies(y) for y in spack.environment.active_environment().all_specs_generator())], False)'

# Same command but only print what would be deleted
# spack python -c 'print([x.name for x in spack.store.STORE.db.query_local() if not any(x.satisfies(y) for y in spack.environment.active_environment().all_specs_generator())])'
# spack -e . python -c 'print([x.name for x in spack.store.STORE.db.query_local() if not any(x.satisfies(y) for y in spack.environment.active_environment().all_specs_generator())])'

0 comments on commit 3419dac

Please sign in to comment.