r59054 - in /branches/upstream/libcpan-meta-perl/current: ./ lib/CPAN/ lib/CPAN/Meta/ t/

ansgar-guest at users.alioth.debian.org ansgar-guest at users.alioth.debian.org
Tue Jun 8 13:49:14 UTC 2010


Author: ansgar-guest
Date: Tue Jun  8 13:40:00 2010
New Revision: 59054

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=59054
Log:
[svn-upgrade] Integrating new upstream version, libcpan-meta-perl (2.101590)

Added:
    branches/upstream/libcpan-meta-perl/current/t/repository.t
Modified:
    branches/upstream/libcpan-meta-perl/current/Changes
    branches/upstream/libcpan-meta-perl/current/MANIFEST
    branches/upstream/libcpan-meta-perl/current/META.json
    branches/upstream/libcpan-meta-perl/current/META.yml
    branches/upstream/libcpan-meta-perl/current/Makefile.PL
    branches/upstream/libcpan-meta-perl/current/README
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm
    branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm

Modified: branches/upstream/libcpan-meta-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/Changes?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/Changes (original)
+++ branches/upstream/libcpan-meta-perl/current/Changes Tue Jun  8 13:40:00 2010
@@ -1,4 +1,12 @@
 Revision history for CPAN-Meta
+
+2.101590  2010-06-07 21:49:36 EST5EDT
+
+  - won't automatically add 'unknown' as repository type when converting; 
+    instead, will only add a repository type if a repository 'url' is
+    present and it is of the 'svn:' or 'git:' scheme.
+
+  - squelched some uninitialized value warnings [Graham Barr]
 
 2.101580  2010-06-07 16:44:13 EST5EDT
 

Modified: branches/upstream/libcpan-meta-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/MANIFEST?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/MANIFEST (original)
+++ branches/upstream/libcpan-meta-perl/current/MANIFEST Tue Jun  8 13:40:00 2010
@@ -58,6 +58,7 @@
 t/prereqs-finalize.t
 t/prereqs-merge.t
 t/prereqs.t
+t/repository.t
 t/save-load.t
 t/validator.t
 xt/release/pod-syntax.t

Modified: branches/upstream/libcpan-meta-perl/current/META.json
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/META.json?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/META.json (original)
+++ branches/upstream/libcpan-meta-perl/current/META.json Tue Jun  8 13:40:00 2010
@@ -56,7 +56,7 @@
          "web" : "http://github.com/dagolden/cpan-meta"
       }
    },
-   "version" : "2.101580",
+   "version" : "2.101590",
    "x_Dist_Zilla" : {
       "plugins" : [
          {

Modified: branches/upstream/libcpan-meta-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/META.yml?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/META.yml (original)
+++ branches/upstream/libcpan-meta-perl/current/META.yml Tue Jun  8 13:40:00 2010
@@ -33,7 +33,7 @@
   version: 0.82
 resources:
   repository: http://github.com/dagolden/cpan-meta.git
-version: 2.101580
+version: 2.101590
 x_Dist_Zilla:
   plugins:
     -

Modified: branches/upstream/libcpan-meta-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/Makefile.PL?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/Makefile.PL (original)
+++ branches/upstream/libcpan-meta-perl/current/Makefile.PL Tue Jun  8 13:40:00 2010
@@ -35,7 +35,7 @@
     'autodie' => '0',
     'version' => '0.82'
   },
-  'VERSION' => '2.101580',
+  'VERSION' => '2.101590',
   'test' => {
     'TESTS' => 't/*.t'
   }

Modified: branches/upstream/libcpan-meta-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/README?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/README (original)
+++ branches/upstream/libcpan-meta-perl/current/README Tue Jun  8 13:40:00 2010
@@ -1,7 +1,7 @@
 
 
 This archive contains the distribution CPAN-Meta,
-version 2.101580:
+version 2.101590:
 
   the distribution metadata for a CPAN dist
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta.pm Tue Jun  8 13:40:00 2010
@@ -4,7 +4,7 @@
 use autodie;
 package CPAN::Meta;
 BEGIN {
-  $CPAN::Meta::VERSION = '2.101580';
+  $CPAN::Meta::VERSION = '2.101590';
 }
 # ABSTRACT: the distribution metadata for a CPAN dist
 
@@ -308,7 +308,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Converter.pm Tue Jun  8 13:40:00 2010
@@ -4,7 +4,7 @@
 use autodie;
 package CPAN::Meta::Converter;
 BEGIN {
-  $CPAN::Meta::Converter::VERSION = '2.101580';
+  $CPAN::Meta::Converter::VERSION = '2.101590';
 }
 # ABSTRACT: Convert CPAN distribution metadata structures
 
@@ -286,9 +286,9 @@
 }
 
 sub _is_module_name {
-  my $key = shift;
-  return unless defined $key && length $key;
-  return $key =~ m{^[A-Za-z][A-Za-z0-9_]*(?:::[A-Za-z0-9_]+)*$};
+  my $mod = shift;
+  return unless defined $mod && length $mod;
+  return $mod =~ m{^[A-Za-z][A-Za-z0-9_]*(?:::[A-Za-z0-9_]+)*$};
 }
 
 sub _clean_version {
@@ -564,10 +564,21 @@
   ':custom'  => \&_prefix_custom,
 };
 
+sub _repo_type {
+  my ($element, $key, $meta, $to_version) = @_;
+  return $element if defined $element;
+  return unless exists $meta->{url};
+  my $repo_url = $meta->{url};
+  for my $type ( qw/git svn/ ) {
+    return $type if $repo_url =~ m{\A$type};
+  }
+  return;
+}
+
 my $repository2_spec = {
   web => \&_url_or_drop,
   url => \&_url_or_drop,
-  type => \&_keep_or_unknown,
+  type => \&_repo_type,
   ':custom'  => \&_prefix_custom,
 };
 
@@ -575,7 +586,7 @@
   license    => \&_url_list,
   homepage   => \&_url_or_drop,
   bugtracker => sub { ref $_[0] ? _convert( $_[0], $bugtracker2_spec ) : undef },
-  repository => sub { ref $_[0] ? _convert( $_[0], $repository2_spec ) : undef },
+  repository => sub { my $data = shift; ref $data ? _convert( $data, $repository2_spec ) : undef },
   ':custom'  => \&_prefix_custom,
 };
 
@@ -628,7 +639,7 @@
 
 sub _release_status {
   my ($element, undef, $meta) = @_;
-  return $element if $element =~ m{\A(?:stable|testing|unstable)\z};
+  return $element if $element && $element =~ m{\A(?:stable|testing|unstable)\z};
   return _release_status_from_version(undef, undef, $meta);
 }
 
@@ -664,7 +675,7 @@
   my ($data, $spec, $to_version) = @_;
 
   my $new_data = {};
-  for my $key ( %$spec ) {
+  for my $key ( keys %$spec ) {
     next if $key eq ':custom' || $key eq ':drop';
     next unless my $fcn = $spec->{$key};
     die "spec for '$key' is not a coderef"
@@ -678,7 +689,7 @@
 
   for my $key ( keys %$data ) {
     next if $drop_list && grep { $key eq $_ } @$drop_list;
-    next if $spec->{$key}; # we handled it
+    next if exists $spec->{$key}; # we handled it
     $new_data->{ $customizer->($key) } = $data->{$key};
   }
 
@@ -1232,7 +1243,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Feature.pm Tue Jun  8 13:40:00 2010
@@ -4,7 +4,7 @@
 use autodie;
 package CPAN::Meta::Feature;
 BEGIN {
-  $CPAN::Meta::Feature::VERSION = '2.101580';
+  $CPAN::Meta::Feature::VERSION = '2.101590';
 }
 # ABSTRACT: an optional feature provided by a CPAN distribution
 
@@ -44,7 +44,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/History.pm Tue Jun  8 13:40:00 2010
@@ -5,7 +5,7 @@
 use autodie;
 package CPAN::Meta::History;
 BEGIN {
-  $CPAN::Meta::History::VERSION = '2.101580';
+  $CPAN::Meta::History::VERSION = '2.101590';
 }
 # ABSTRACT: history of CPAN Meta Spec changes
 1;
@@ -21,7 +21,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Prereqs.pm Tue Jun  8 13:40:00 2010
@@ -4,7 +4,7 @@
 use autodie;
 package CPAN::Meta::Prereqs;
 BEGIN {
-  $CPAN::Meta::Prereqs::VERSION = '2.101580';
+  $CPAN::Meta::Prereqs::VERSION = '2.101590';
 }
 # ABSTRACT: a set of distribution prerequisites by phase and type
 
@@ -151,7 +151,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 DESCRIPTION
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Spec.pm Tue Jun  8 13:40:00 2010
@@ -5,7 +5,7 @@
 use autodie;
 package CPAN::Meta::Spec;
 BEGIN {
-  $CPAN::Meta::Spec::VERSION = '2.101580';
+  $CPAN::Meta::Spec::VERSION = '2.101590';
 }
 # ABSTRACT: specification for CPAN distribution metadata
 1;
@@ -21,7 +21,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 SYNOPSIS
 

Modified: branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm?rev=59054&op=diff
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm (original)
+++ branches/upstream/libcpan-meta-perl/current/lib/CPAN/Meta/Validator.pm Tue Jun  8 13:40:00 2010
@@ -4,7 +4,7 @@
 use autodie;
 package CPAN::Meta::Validator;
 BEGIN {
-  $CPAN::Meta::Validator::VERSION = '2.101580';
+  $CPAN::Meta::Validator::VERSION = '2.101590';
 }
 # ABSTRACT: validate CPAN distribution metadata structures
 
@@ -841,7 +841,7 @@
 
 =head1 VERSION
 
-version 2.101580
+version 2.101590
 
 =head1 SYNOPSIS
 

Added: branches/upstream/libcpan-meta-perl/current/t/repository.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcpan-meta-perl/current/t/repository.t?rev=59054&op=file
==============================================================================
--- branches/upstream/libcpan-meta-perl/current/t/repository.t (added)
+++ branches/upstream/libcpan-meta-perl/current/t/repository.t Tue Jun  8 13:40:00 2010
@@ -1,0 +1,225 @@
+use strict;
+use warnings;
+use Test::More 0.88;
+
+use CPAN::Meta;
+
+# 1.4 repository upgrade
+{
+  my $label = "(version 1.4) old repository winds up in 'web'";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '1.4',
+        url     => 'http://module-build.sourceforge.net/META-spec-v1.4.html',
+      },
+      resources => {
+        repository => 'http://example.com/',
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+  is_deeply(
+    $meta->resources,
+    {
+      repository => {
+        web => 'http://example.com/',
+      },
+    },
+    $label,
+  );
+}
+
+{
+  my $label = "(version 2  ) http in web passed through unchanged";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '2',
+      },
+      resources => {
+        repository => {
+          web => 'http://example.com/',
+        },
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+
+  is_deeply(
+    $meta->{resources},
+    {
+      repository => {
+        web => 'http://example.com/',
+      },
+    },
+    $label
+  );
+}
+
+{
+  my $label = "(version 2  ) http in url passed through unchanged";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '2',
+      },
+      resources => {
+        repository => {
+          url => 'http://example.com/',
+        },
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+
+  is_deeply(
+    $meta->{resources},
+    {
+      repository => {
+        url => 'http://example.com/',
+      },
+    },
+    $label
+  );
+}
+
+{
+  my $label = "(version 2  ) svn in url adds svn type";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '2',
+      },
+      resources => {
+        repository => {
+          url => 'svn://example.com/',
+        },
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+
+  is_deeply(
+    $meta->{resources},
+    {
+      repository => {
+        url => 'svn://example.com/',
+        type => 'svn',
+      },
+    },
+    $label
+  );
+}
+
+{
+  my $label = "(version 2  ) git in url adds svn type";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '2',
+      },
+      resources => {
+        repository => {
+          url => 'git://example.com/',
+        },
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+
+  is_deeply(
+    $meta->{resources},
+    {
+      repository => {
+        url => 'git://example.com/',
+        type => 'git',
+      },
+    },
+    $label
+  );
+}
+
+{
+  my $label = "(version 2  ) pre-existing type preserved";
+  my $meta = CPAN::Meta->new(
+    {
+      name     => 'Module-Billed',
+      abstract => 'inscrutable',
+      version  => '1',
+      author   => 'Joe',
+      release_status => 'stable',
+      license  => 'perl_5',
+      dynamic_config => 1,
+      generated_by   => 'hand',
+      'meta-spec' => {
+        version => '2',
+      },
+      resources => {
+        repository => {
+          url => 'git://example.com/',
+          type => 'msysgit',
+        },
+      },
+    },
+    { lazy_validation => 1 },
+  );
+
+
+  is_deeply(
+    $meta->{resources},
+    {
+      repository => {
+        url => 'git://example.com/',
+        type => 'msysgit',
+      },
+    },
+    $label
+  );
+}
+done_testing;




More information about the Pkg-perl-cvs-commits mailing list