From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RKwEx-0005Sb-Ak for garchives@archives.gentoo.org; Mon, 31 Oct 2011 18:05:43 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EB0C021C025; Mon, 31 Oct 2011 18:05:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id A52B321C025 for ; Mon, 31 Oct 2011 18:05:34 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B02771B4006 for ; Mon, 31 Oct 2011 18:05:33 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 167688004A for ; Mon, 31 Oct 2011 18:05:33 +0000 (UTC) From: "Kent Fredric" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Kent Fredric" Message-ID: <327a4ed4a91cc5803d80fa1134cdcaac8b22dd3b.kent@gentoo> Subject: [gentoo-commits] proj/perl-overlay:master commit in: scripts/ X-VCS-Repository: proj/perl-overlay X-VCS-Files: scripts/dual-life.pl X-VCS-Directories: scripts/ X-VCS-Committer: kent X-VCS-Committer-Name: Kent Fredric X-VCS-Revision: 327a4ed4a91cc5803d80fa1134cdcaac8b22dd3b Date: Mon, 31 Oct 2011 18:05:33 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 148d1ea7-8611-47a3-8a57-9e10453c62b5 X-Archives-Hash: 83a9646a1b0621ad7df079e1d0e207bd commit: 327a4ed4a91cc5803d80fa1134cdcaac8b22dd3b Author: Kent Fredric gmail com> AuthorDate: Mon Oct 31 18:04:47 2011 +0000 Commit: Kent Fredric gmail com> CommitDate: Mon Oct 31 18:04:47 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/perl-overlay.= git;a=3Dcommit;h=3D327a4ed4 [scripts/dual-life.pl] Tidy code --- scripts/dual-life.pl | 57 +++++++++++++++++++++++---------------------= ----- 1 files changed, 27 insertions(+), 30 deletions(-) diff --git a/scripts/dual-life.pl b/scripts/dual-life.pl index 458e1f9..9d7fe80 100644 --- a/scripts/dual-life.pl +++ b/scripts/dual-life.pl @@ -23,9 +23,7 @@ my $perls =3D { stable =3D> CoreGroup->new( name =3D> 'stable', perls =3D= > [qw( 5.12.3 5.12.4 )] ), }; =20 - -pp $perls->{masked_future}->get_perl(qw( 5.14.2 ))->delta(=20 - $perls->{stable}->get_perl(qw( 5.12.4 )) ); +pp $perls->{masked_future}->get_perl(qw( 5.14.2 ))->delta( $perls->{stab= le}->get_perl(qw( 5.12.4 )) ); =20 #for my $group ( $perls->{masked_future} ) { # for my $perl ( values $group->perls ) { @@ -83,49 +81,47 @@ BEGIN { =20 __PACKAGE__->meta->make_immutable; =20 - sub delta { - my ( $self, $other ) =3D @_ ;=20 - my ( %all ) =3D map { $_ , 1 }=20 + my ( $self, $other ) =3D @_; + my (%all) =3D map { $_, 1 } $self->module_names, $other->module_names; my %diffs; for my $module ( keys %all ) { - if( $self->has_module( $module ) and not $other->has_module( $modu= le ) ) { + if ( $self->has_module($module) and not $other->has_module($module= ) ) { $diffs{$module} =3D { - kind =3D> 'ours', - available_in =3D> $self->perl_version, - not_available_in =3D> $other->perl_version, - module =3D> $module, - available_version =3D> $self->module( $module )->version, + kind =3D> 'ours', + available_in =3D> $self->perl_version, + not_available_in =3D> $other->perl_version, + module =3D> $module, + available_version =3D> $self->module($module)->version, }; next; } - if( not $self->has_module( $module ) and $other->has_module( $modu= le ) ) { + if ( not $self->has_module($module) and $other->has_module($module= ) ) { $diffs{$module} =3D { - kind =3D> 'theirs', - available_in =3D> $other->perl_version, - not_available_in =3D> $self->perl_version, - module =3D> $module, - available_version =3D> $other->module( $module )->version, + kind =3D> 'theirs', + available_in =3D> $other->perl_version, + not_available_in =3D> $self->perl_version, + module =3D> $module, + available_version =3D> $other->module($module)->version, }; next; } - if ( ( $self->module( $module )->version // 'undef' ) ne ( $other-= >module($module)->version // 'undef' ) ) { - $diffs{$module} =3D {=20 - kind =3D> 'cross', - module =3D> $module, - our_version =3D> $self->module( $module )->version, - their_version =3D> $other->module( $module )->version, - our_perl =3D> $self->perl_version, - their_perl =3D> $other->perl_version, + if ( ( $self->module($module)->version // 'undef' ) ne ( $other->m= odule($module)->version // 'undef' ) ) { + $diffs{$module} =3D { + kind =3D> 'cross', + module =3D> $module, + our_version =3D> $self->module($module)->version, + their_version =3D> $other->module($module)->version, + our_perl =3D> $self->perl_version, + their_perl =3D> $other->perl_version, }; } =20 } return \%diffs; } - =20 =20 # BUILDERS sub _build_perl_version { @@ -184,16 +180,17 @@ BEGIN { __PACKAGE__->meta->make_immutable; =20 sub get_perl { - my ($self,$perlv) =3D @_; - if ( not exists $self->perls->{$perlv} ) {=20 + my ( $self, $perlv ) =3D @_; + if ( not exists $self->perls->{$perlv} ) { die "No key $perlv"; } return $self->perls->{$perlv}; } + # BUILDERS sub _build_perls { my $self =3D shift; - return { map { $_ , CoreList::Single->new( coregroup =3D> $self->nam= e, perl =3D> $_ ) } @{ $self->_perls } }; + return { map { $_, CoreList::Single->new( coregroup =3D> $self->name= , perl =3D> $_ ) } @{ $self->_perls } }; } =20 }