diff options
author | Michael Cummings <mcummings@gentoo.org> | 2005-04-16 02:47:26 +0000 |
---|---|---|
committer | Michael Cummings <mcummings@gentoo.org> | 2005-04-16 02:47:26 +0000 |
commit | 8747c63a2952d31d9f7ca30126d19a915a014bf2 (patch) | |
tree | 247348c5e2fedeef79deb2444a4ecb69ad228b4e | |
parent | portage-pkg -> binpkgs (diff) | |
download | portage-cvs-8747c63a2952d31d9f7ca30126d19a915a014bf2.tar.gz portage-cvs-8747c63a2952d31d9f7ca30126d19a915a014bf2.tar.bz2 portage-cvs-8747c63a2952d31d9f7ca30126d19a915a014bf2.zip |
dev-perl/module-build will now add as a dep *IF NEEDED ONLY* (versus my last choice of behaviors, everyone enjoys it)
-rwxr-xr-x | bin/g-cpan.pl | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/g-cpan.pl b/bin/g-cpan.pl index a2a1aae..2e4e799 100755 --- a/bin/g-cpan.pl +++ b/bin/g-cpan.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/Attic/g-cpan.pl,v 1.18 2005/03/14 19:06:17 mcummings Exp $ +# $Header: /local/data/ulm/cvs/history/var/cvsroot/gentoo-src/portage/bin/Attic/g-cpan.pl,v 1.19 2005/04/16 02:47:26 mcummings Exp $ # History: @@ -192,7 +192,9 @@ sub portage_dir { if ( $file =~ m|.*/(.*)-[0-9]+\.| ) { return $1; } if ( $file =~ m|.*/([a-zA-Z-]*)[0-9]+\.| ) { return $1; } if ( $file =~ m|.*/([^.]*)\.| ) { return $1; } + warn "$0: Unable to coerce $file into a portage dir name"; + return; } @@ -254,6 +256,7 @@ HERE if ( $prereq_pm && keys %$prereq_pm ) { print EBUILD q|DEPEND="|; + #MPC print EBUILD q|DEPEND="dev-perl/module-build |; my $first = 1; my %dup_check; @@ -261,6 +264,7 @@ HERE my $obj = CPAN::Shell->expandany($_); my $dir = portage_dir($obj); + if ( $dir eq "Module-Build" ) { $dir = "module-build" } next if $dir eq "perl"; if ( ( !$dup_check{$dir} ) && ( !module_check($dir) ) ) { $dup_check{$dir} = 1; @@ -324,6 +328,9 @@ sub install_module { my $pack = $CPAN::META->instance( 'CPAN::Distribution', $file ); $pack->called_for( $obj->id ); $pack->make; + # A cheap ploy, but this lets us add module-build as needed instead of forcing it on everyone + my $add_mb = 0; + if (-f "Build.PL") { $add_mb = 1 } $pack->unforce if $pack->can("unforce") && exists $obj->{'force_update'}; delete $obj->{'force_update'}; @@ -347,6 +354,7 @@ sub install_module { # make ebuilds for all the prereqs my $prereq_pm = $pack->prereq_pm; + if ($add_mb) {$prereq_pm->{'Module::Build'} = "0" } install_module($_, 1) for ( keys %$prereq_pm ); # get the build dir from CPAN, this will tell us definitively |