-1

I've just installed macports. The postflight script has somehow modified my PATH variable so that the macports binaries now take precedence in ways I don't like. For example, it has downgraded rustc.

I've tried to find out where macports has added itself to the path. I couldn't find any mention of /opt/local/bin anywhere in ~/.zshrc and the like.

Neither did looking in macports docs help.

6
  • It is documented on the macports install instructions page macports.org/install.php which links to guide.macports.org/#installing.shell for details - where would you want it documented.
    – mmmmmm
    Dec 24, 2023 at 10:05
  • @mmmmmmm It says about as much as I knew and put in the question. There's no mention at all of .zprofile, the most common file to be modified on modern macOS. Dec 24, 2023 at 19:53
  • second paragraph on "macOS Package (.pkg) Inst" says - If needed your shell configuration files will be adapted by the installer.
    – mmmmmm
    Dec 26, 2023 at 18:52
  • Indeed, but the documentation says: Depending on your shell and which configuration files already exist, the installer may use .profile, .bash_login, .bash_profile, .tcshrc, or .cshrc. - .zprofile is glaringly missing and should be added. Dec 26, 2023 at 23:21
  • 1
    I've opened a PR to add that one file to the list Dec 29, 2023 at 18:46

1 Answer 1

0

I've found it in ~/.zprofile:

##
# Your previous /Users/xxx/.zprofile file was backed up as /Users/xxx/.zprofile.macports-saved_2023-12-24_at_02:48:28
##

# MacPorts Installer addition on 2023-12-24_at_02:48:28: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.


# MacPorts Installer addition on 2023-12-24_at_02:48:28: adding an appropriate MANPATH variable for use with MacPorts.
export MANPATH="/opt/local/share/man:$MANPATH"
# Finished adapting your MANPATH environment variable for use with MacPorts.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .