Support for package *alternatives*
Some packages offer alternatives meaning they offer the same binary binary path. An example would be that both dropbear
and openssh
offer scp
to transfer files. Another is that busybox
offers many packages from coreutils
.
To handle this some package managers offer handling of alternatives
, which can be implemented in an array of triplets per package. Each triplet contain priority, symlink path and package path. Whenever a package is installed the symlink paths are compared and the package path with the highest priority is selected. A symlink is created which points the symlink path to the package path.
For example, the dropbear
package may contain the triplet 100:/usr/bin/scp:usr/sbin/dropbear
, the openssh
package may contain the triplet 200:/usr/bin/scp:/usr/libexec/scp-openss
. If both packages are installed, the one with highest priority (openssh
) is symlinked.
This would be run whenever a package is installed or removed. The package manager OPKG implement the behaviour in a few lines of code, maybe we can create something similar?