From: Vincent Pit Date: Fri, 13 Aug 2010 17:36:02 +0000 (+0200) Subject: Use >= as the default atom range X-Git-Tag: v0.11~24 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=35a371dbbbb9ba8cd3d67c4b1763a93ac0572006;p=perl%2Fmodules%2FCPANPLUS-Dist-Gentoo.git Use >= as the default atom range --- diff --git a/lib/CPANPLUS/Dist/Gentoo.pm b/lib/CPANPLUS/Dist/Gentoo.pm index 0003b36..051378a 100644 --- a/lib/CPANPLUS/Dist/Gentoo.pm +++ b/lib/CPANPLUS/Dist/Gentoo.pm @@ -565,11 +565,10 @@ sub ebuild_source { push @requires, $atom; } - my $min_perl = $stat->min_perl; my $perl = CPANPLUS::Dist::Gentoo::Atom->new( category => 'dev-lang', name => 'perl', - (defined $min_perl ? (version => $min_perl, range => '>=') : ()), + version => $stat->min_perl, ); @requires = CPANPLUS::Dist::Gentoo::Atom->fold($perl, @requires); @@ -619,7 +618,7 @@ sub _cpan2portage { return CPANPLUS::Dist::Gentoo::Atom->new( category => $last->category, name => $last->name, - (defined $version ? (version => $version, range => '>=') : ()), + version => $version, ebuild => $last->ebuild, ); } diff --git a/lib/CPANPLUS/Dist/Gentoo/Atom.pm b/lib/CPANPLUS/Dist/Gentoo/Atom.pm index 565178e..bbb6d88 100644 --- a/lib/CPANPLUS/Dist/Gentoo/Atom.pm +++ b/lib/CPANPLUS/Dist/Gentoo/Atom.pm @@ -74,7 +74,7 @@ sub new { Carp::confess("Invalid range $range") unless grep $range eq $_, qw|< <= = >= >|; } else { - $range = '='; + $range = '>='; } } else { Carp::confess('Range atoms require a valid version') diff --git a/t/30-atom-new.t b/t/30-atom-new.t index c4dcdbe..b44f937 100644 --- a/t/30-atom-new.t +++ b/t/30-atom-new.t @@ -22,18 +22,18 @@ my @tests = ( [ { category => 'test' } => $no_info ], [ $a0 => $a0 ], [ { %$a0, range => '<=' } => $range_no_ver ], - [ $a1 => { %$a1, range => '=' } ], + [ $a1 => { %$a1, range => '>=' } ], [ { %$a1, range => '<=' } => { %$a1, range => '<=' } ], [ { atom => 'test/a' } => $a0 ], - [ { atom => 'test/a-1.0' } => { %$a1, range => '=' } ], - [ { atom => '>=test/a-v1.0' } => { %$a1, range => '>=' } ], + [ { atom => 'test/a-1.0' } => { %$a1, range => '>=' } ], + [ { atom => '=test/a-v1.0' } => { %$a1, range => '=' } ], [ { atom => '= $inv_atom ], [ { atom => '>=test/a' } => $range_no_ver ], [ { ebuild => undef } => $inv_ebuild ], [ { ebuild => '/wat/test/a/a.ebuild' } => $inv_ebuild ], - [ { ebuild => '/wat/test/a/a-1.0.ebuild' } => { %$a1, range => '=' } ], + [ { ebuild => '/wat/test/a/a-1.0.ebuild' } => { %$a1, range => '>=' } ], [ { ebuild => '/wat/test/a/b-1.0.ebuild' } => $inv_ebuild ], );