User:Kentnl/Perl Autovirtuals
From Gentoo Wiki
Jump to:navigation
Jump to:search
- Eliminate
virtual/perl-*
- All
perl-core/*
is an "autovirtual" - All
perl-core/*
uses a special valueSUPPORTING_PERLS
that indicates which perls ship with the relevantperl-core
- All
perl-core/*
employs a conditional dep of|| ( supporting_perl_b supporting_perl_b ( NORMALDEPS ))
- All
perl-core/*
does a runtimeperl -e'print $]'
- Based on that value, if that value is in the list of "SUPPORTING PERLS", then the ebuild changes beahaviour
- And behaviour changes to a No-OP of installing no files.
- You could plausibly have a USE flag to force one of the two install paths.
Advantages:
- Can be expected to work usefully even if the
SUPPORTING_PERLS
is not properly updated, without causing too much fallout ( It will still be a problem for some not-on-cpan-yet things, but that's not going away ) - Unlike the current virtual scenario where changing from using "perl-core/*" to using "Perl itself" results in a cruft ebuild lying around, this removes the un-needed files automatically.
- This completely avoids the
=virtual/perl-Foo-5
+=perl-core/Foo-6
problem which normally results inportage
expectingFoo.pm == 5
whileperl
seesFoo.pm == 6
Disadvantages:
- Slightly increased rebuild requirement for users, but this is a present problem with virtuals anyway, just they'll be rebuilding the package, not the virtual.
Implementation:
SUPPORTING_PERLS="5.020000 5.020001" # $] values inherit perl-core-module ... DEPEND=" ||( $PLSUPPORTED ( NORMALDEPS ))" RDEPEND="||( $PLSUPPORTED ( NORMALDEPS ))"
( NORMALDEPS )
would be excluded if the module in question was not available via CPAN.- Falling back to "CPAN" and checking
$]
would be disabled either explicitly (???) or by SRC_URI being empty. $PLSUPPORTED
would be produced byperl-core-module
usingSUPPORTING_PERLS