Fix ownership of files created by conda init
for PKG
installers.
#939
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
When PKG installers are installed outside the
$HOME
directory, the installer installs asroot
(even though$USER
is still the user executing the installer). This causes files and directories created byconda init
to be owned byroot
. The current script appears to only pick up the first modified file so that some files are still owned by root. This PR fixes the issue by using a more bash v3 compliant way to read the multi-line string.I'm not sure how this can be tested on the CI since the only time this problem appears is when the PKG installers are run interactively and the destination path is not inside
$HOME
. I don't know if this can be replicated on the CI.However, I have created a Miniconda installer with this script and it had the correct permissions on macOS 12 and 15. It even fixed a previous installation that had the incorrect permissions.
P.S.: I will be on vacation until March 3rd, so I won't be able to address comments until then.
Checklist - did you ...
news
directory (using the template) for the next release's release notes?Add / update necessary tests?