key4hep / key4hep-spack

A Spack recipe repository of Key4hep software.
10 stars 23 forks source link

Use `/usr/bin/ls` to avoid using aliases from the user in the setup scripts #584

Closed BrieucF closed 4 months ago

BrieucF commented 5 months ago

In several scenarios (e.g. loading twice the stack), the aliases were not given back to the user

jmcarcell commented 4 months ago

The context is that I made some changes here since Brieuc reported an issue where an user can make the setup scripts misbehave with weird errors by aliasing commands that are used by the script.

I'll make a few changes to this PR because I'd prefer if the aliases could be unset only if the actual script is going to be sourced so we only have to make sure they are given back for one exit path and not all of them

jmcarcell commented 4 months ago

Change of plans: let's just use /usr/bin/ls and assume people won't have aliases for other commands that will mess up the script. Removing and setting back the aliases is a bit ugly and has to be done for every entry and exit path in the script