Skip to content

Commit

Permalink
also match output when force option is used
Browse files Browse the repository at this point in the history
  • Loading branch information
truib committed Nov 23, 2024
1 parent 9322c19 commit 892337a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions EESSI-remove-software.sh
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,15 @@ if [ $EUID -eq 0 ]; then
if [ -f ${easystack_file} ]; then
echo_green "Software rebuild(s) requested in ${easystack_file}, so determining which existing installation have to be removed..."
# we need to remove existing installation directories first,
# so let's figure out which modules have to be rebuilt by doing a dry-run and grepping "someapp/someversion" for the relevant lines (with [R])
# so let's figure out which modules have to be rebuilt by doing a
# dry-run and grepping "someapp/someversion" for the relevant
# lines (with [R] or [F], the latter may be shown when the option
# --force is used)
# * [R] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion)
# or
# * [F] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion)
eb --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file}
rebuild_apps=$(eb --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[R\]" | grep -o "module: .*[^)]" | awk '{print $2}')
rebuild_apps=$(eb --allow-use-as-root-and-accept-consequences --dry-run-short --rebuild --easystack ${easystack_file} | grep "^ \* \[[FR]\]" | grep -o "module: .*[^)]" | awk '{print $2}')
for app in ${rebuild_apps}; do
# Returns e.g. /cvmfs/software.eessi.io/versions/2023.06/software/linux/x86_64/amd/zen2/modules/all:
app_modulepath=$(module --terse av ${app} 2>&1 | head -n 1 | sed 's/://')
Expand Down

0 comments on commit 892337a

Please sign in to comment.