90
90
pr_diff=$( ls [0-9]* .diff | head -1)
91
91
92
92
# if this script is run as root, use PR patch file to determine if software needs to be removed first
93
- if [ $EUID -eq 0 ]; then
93
+ # if [ $EUID -eq 0 ]; then
94
+ # working around lacking support for `--fakeroot` and/or user namespaces
95
+ # we only run as non-root
96
+ if [ $EUID -ne 0 ]; then
94
97
changed_easystacks_rebuilds=$( cat ${pr_diff} | grep ' ^+++' | cut -f2 -d' ' | sed ' s@^[a-z]/@@g' | grep ' ^easystacks/.*yml$' | egrep -v ' known-issues|missing' | grep " /rebuilds/" )
95
98
if [ -z ${changed_easystacks_rebuilds} ]; then
96
99
echo " No software needs to be removed."
@@ -107,19 +110,25 @@ if [ $EUID -eq 0 ]; then
107
110
# we need to remove existing installation directories first,
108
111
# 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])
109
112
# * [R] $CFGS/s/someapp/someapp-someversion.eb (module: someapp/someversion)
110
- 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}' )
113
+ # 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}')
114
+ # we cannot run as root so we removed `--allow-use-as-root...`
115
+ rebuild_apps=$( eb --dry-run-short --rebuild --easystack ${easystack_file} | grep " ^ \* \[R\]" | grep -o " module: .*[^)]" | awk ' {print $2}' )
111
116
for app in ${rebuild_apps} ; do
112
117
app_dir=${EASYBUILD_INSTALLPATH} /software/${app}
113
118
app_module=${EASYBUILD_INSTALLPATH} /modules/all/${app} .lua
114
- echo_yellow " Removing ${app_dir} and ${app_module} ..."
115
- rm -rf ${app_dir}
116
- rm -rf ${app_module}
119
+ echo_yellow " Removing ${app_dir} and ${app_module} ... (just reporting what would have been done)"
120
+ # echo_yellow "Removing ${app_dir} and ${app_module}..."
121
+ # rm -rf ${app_dir}
122
+ # rm -rf ${app_module}
117
123
done
118
124
else
119
125
fatal_error " Easystack file ${easystack_file} not found!"
120
126
fi
121
127
done
122
128
fi
123
129
else
124
- fatal_error " This script can only be run by root!"
130
+ fatal_error " This script can NOT be run by root! (lacking support for ` --fakeroot ` and/or user namespaces) "
125
131
fi
132
+ # else
133
+ # fatal_error "This script can only be run by root!"
134
+ # fi
0 commit comments