Skip to content

Tips for linking / unlinking a whole collection #3406

@scpeters

Description

@scpeters

Since we removed version numbers from formula names and there are conflicts between Jetty and Rotary formulae, I find myself brew linking and brew unlinking when switching between Jetty and Rotary. All the individual rotary formula names start with gz-rotary-*, and we have gz-jetty-* symlinks in the Aliases folder, but aliases aren't treated the same as formula names for all commands. Here are some of the tricks I'm currently using with examples for installing Jetty, then Rotary, then switching back to Rotary

Installing Jetty on a fresh system

It's easy to install the first set of Gazebo packages on a system, since there will be no conflicts. You can install a single package, such as gz-math:

brew install gz-jetty-math

or the entire Jetty collection:

brew install gz-jetty

Unlink Jetty and install Rotary

It's straightforward to unlink a single package since brew unlink handles formulae aliases (and remember to install Rotary formulae with --HEAD):

brew unlink gz-jetty-math
brew install gz-rotary-math --HEAD

In order to unlink the all Jetty formulae, I currently change directory to the Aliases folder of this tap to rely on bash * globbing of local files:

cd $(brew --repo osrf/simulation)/Aliases
brew unlink gz-jetty-*
brew install gz-rotary --HEAD

Unlink Rotary and re-link Jetty

For a single package:

brew unlink gz-rotary-math
brew link gz-jetty-math

To unlink all Rotary formulae, I currently change directory to Homebrew's opt folder (similar to the Cellar), but I then have to switch back to the Aliases folder to link Jetty formulae, since the jetty aliases don't always exist in the opt folder:

cd $(brew --prefix)/opt
brew unlink gz-rotary-*
cd $(brew --repo osrf/simulation)/Aliases
brew link gz-jetty-*

Unlink Jetty and re-link Rotary

For a single package:

brew unlink gz-jetty-math
brew link gz-rotary-math

If you followed the previous step to link all Jetty formula, then their aliases should all exist in the opt folder, so I think only one cd is necessary:

cd $(brew --prefix)/opt
brew unlink gz-jetty-*
brew link gz-rotary-*

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions