Closed omern1 closed 8 years ago
I always wondered if Linuxbrew could make "virtual" installations into the Cellar by symlinking to an installed system package by querying the rpm/deb. ie. "mirror an RPM into the Cellar"
@tseemann That is actually a very good idea.
Yep, that would work. I've done something like that on an ad hoc basis occasionally. I wouldn't want it to be the default behaviour, because the version provided by the system, may not be compatible with the version expected to be installed by Linuxbrew.
Could you share how you did it?
Theoretically, Linuxbrew could check if the version installed by the system is the compatible with what the formula requires.
Could you share how you did it?
Manually, but it could be automated. For example:
mkdir -p `brew --cellar`/xz/5.2.2/bin `brew --cellar`/xz/5.2.2/lib
ln -s /usr/bin/xz `brew --cellar`/xz/5.2.2/bin/
ln -s /usr/lib/libxz* `brew --cellar`/xz/5.2.2/lib
brew link xz
Theoretically, Linuxbrew could check if the version installed by the system is the compatible with what the formula requires.
In fact, if you ran brew upgrade
it would upgrade any host kegs that were older than the version provided by Linuxbrew unless you pinned the host keg.
Would you be fine with this behavior if Linuxbrew checked whether the version provided by APT or whatever is the same that the formula requires?
There's so many places that this feature could break things. For it to work we'd need to create a mapping from Linuxbrew package names to host package names. I'm not sure it's worth the trouble. Once Linuxbrew formula are all bottled (binary packages are provide), which I'm working on, I'm not sure using host packages is necessary.
One problem I see with this approach is that formula names may differ from system packages (be it APT, yum, or whatever). Another: all those native package managers... their name is Legion. https://www.youtube.com/watch?v=jGALJwdBOX4
Useful on occasion for packages without Linuxbrew formula. Closing as wontfix due to the grief that mixing package managers can create.
Some dependencies may already be installed on the system by the platform's native package manager, Linux brew should check whether any of these are installed before installing them.