User:Kentnl/PerlBinAlternatives

From Gentoo Wiki
Jump to:navigation Jump to:search

The current strategy we have for managing binaries in /usr/bin/ is bit rough and confusing.

Proposal

 /usr/libexec/perl/
 /usr/libexec/perl/10-native/
 /usr/libexec/perl/20-perl-core/
 /usr/libexec/perl/30-dev-perl/
 /usr/libexec/perl/40-misc/

dev-lang/perl/*.ebuild installs all bin scripts into

  /usr/libexec/perl/10-native/

perl-core/*/*.ebuild install all bin scripts into

  /usr/libexec/perl/20-perl-core/

dev-perl/*/*.ebuild install all bin scripts into

  /usr/libexec/perl/30-dev-perl/

Everything else that installs things that might need alternatives support into

 /usr/libexec/perl/40-misc/

Or similar, packages can define their own place if they really want to.

Package Post Install / Package Post Remove

1. Iterate /usr/libexec/perl/* in numerical order

2. Generate a basename,dirname pair for all entries where "dirname" is the leaf of the "last seen instance of basename"

3. Compare with existing pair-list to determine basename values that should be unlinked

4. Compare with existing pair-list to determine which basename values should be re-linked

5. Compare with existing pair-list to determine which basename values should be created

6. Execute indicated actions gathered from steps 3-5

7. Replace old pair-list with new pair-list