From: Karen Etheridge Date: Sat, 22 Dec 2012 08:07:36 +0000 (-0800) Subject: no trailing whitespace X-Git-Tag: v1.000012~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=dd5a4b10a5e1a7e13fc31c6001ebb21628642c6a;p=p5sagit%2FModule-Metadata.git no trailing whitespace --- diff --git a/Changes b/Changes index 36f71ac..6bb0c82 100644 --- a/Changes +++ b/Changes @@ -5,10 +5,10 @@ 1.0.10_002 2012-08-16 01:00:00 - Remove other spurious message (APEIRON) -1.0.10_002 2012-08-15 20:15:00 +1.0.10_002 2012-08-15 20:15:00 - APEIRON is an idiot (APEIRON) -1.0.10_001 2012-08-15 20:00:00 +1.0.10_001 2012-08-15 20:00:00 - Dev release to test removing a warning about modules not using the 'eval $VERSION' syntax which causes lots of spew. (APEIRON) diff --git a/lib/Module/Metadata.pm b/lib/Module/Metadata.pm index e3c2504..d992477 100644 --- a/lib/Module/Metadata.pm +++ b/lib/Module/Metadata.pm @@ -93,16 +93,16 @@ sub new_from_module { } { - + my $compare_versions = sub { my ($v1, $op, $v2) = @_; $v1 = version->new($v1) unless UNIVERSAL::isa($v1,'version'); - + my $eval_str = "\$v1 $op \$v2"; my $result = eval $eval_str; log_info { "error comparing versions: '$eval_str' $@" } if $@; - + return $result; }; @@ -128,7 +128,7 @@ sub new_from_module { my $resolve_module_versions = sub { my $packages = shift; - + my( $file, $version ); my $err = ''; foreach my $p ( @$packages ) { @@ -146,17 +146,17 @@ sub new_from_module { } $file ||= $p->{file} if defined( $p->{file} ); } - + if ( $err ) { $err = " $file ($version)\n" . $err; } - + my %result = ( file => $file, version => $version, err => $err ); - + return \%result; }; @@ -221,16 +221,16 @@ sub new_from_module { my $mapped_filename = File::Spec::Unix->abs2rel( $file, $dir ); my @path = split( /\//, $mapped_filename ); (my $prime_package = join( '::', @path )) =~ s/\.pm$//; - + my $pm_info = $class->new_from_file( $file ); - + foreach my $package ( $pm_info->packages_inside ) { next if $package eq 'main'; # main can appear numerous times, ignore next if $package eq 'DB'; # special debugging package, ignore next if grep /^_/, split( /::/, $package ); # private package, ignore - + my $version = $pm_info->version( $package ); - + $prime_package = $package if lc($prime_package) eq lc($package); if ( $package eq $prime_package ) { if ( exists( $prime{$package} ) ) { @@ -248,15 +248,15 @@ sub new_from_module { } } } - + # Then we iterate over all the packages found above, identifying conflicts # and selecting the "best" candidate for recording the file & version # for each package. foreach my $package ( keys( %alt ) ) { my $result = $resolve_module_versions->( $alt{$package} ); - + if ( exists( $prime{$package} ) ) { # primary package selected - + if ( $result->{err} ) { # Use the selected primary package, but there are conflicting # errors among multiple alternative packages that need to be @@ -266,11 +266,11 @@ sub new_from_module { " $prime{$package}{file} ($prime{$package}{version})\n" . $result->{err} }; - + } elsif ( defined( $result->{version} ) ) { # There is a primary package selected, and exactly one # alternative package - + if ( exists( $prime{$package}{version} ) && defined( $prime{$package}{version} ) ) { # Unless the version of the primary package agrees with the @@ -286,28 +286,28 @@ sub new_from_module { " $result->{file} ($result->{version})\n" }; } - + } else { # The prime package selected has no version so, we choose to # use any alternative package that does have a version $prime{$package}{file} = $result->{file}; $prime{$package}{version} = $result->{version}; } - + } else { # no alt package found with a version, but we have a prime # package so we use it whether it has a version or not } - + } else { # No primary package was selected, use the best alternative - + if ( $result->{err} ) { log_info { "Found conflicting versions for package '$package'\n" . $result->{err} }; } - + # Despite possible conflicting versions, we choose to record # something rather than nothing $prime{$package}{file} = $result->{file}; @@ -315,17 +315,17 @@ sub new_from_module { if defined( $result->{version} ); } } - + # Normalize versions. Can't use exists() here because of bug in YAML::Node. # XXX "bug in YAML::Node" comment seems irrelvant -- dagolden, 2009-05-18 for (grep defined $_->{version}, values %prime) { $_->{version} = $normalize_version->( $_->{version} ); } - + return \%prime; } -} - +} + sub _init { my $class = shift; @@ -583,7 +583,7 @@ sub _parse_fh { unless ( defined $vers{$pkg} && length $vers{$pkg} ) { $vers{$pkg} = $v; - } + } } diff --git a/maint/bump-version b/maint/bump-version index 26de88b..f3b01e6 100755 --- a/maint/bump-version +++ b/maint/bump-version @@ -13,7 +13,7 @@ my $OLD_DECIMAL = sprintf('%i.%03i%03i', @parts); my %bump_part = (major => 0, minor => 1, bugfix => 2); -my $bump_this = +my $bump_this = $bump_part{$ARGV[0]||'bugfix'} // die "no idea which part to bump - $ARGV[0] means nothing to me";