r30687 - in /branches/upstream/libpar-dist-perl/current: Changes META.yml Makefile.PL lib/PAR/Dist.pm t/03merge_meta.t t/data/dist2.par

rmayorga at users.alioth.debian.org rmayorga at users.alioth.debian.org
Sat Feb 14 01:57:49 UTC 2009


Author: rmayorga
Date: Sat Feb 14 01:57:46 2009
New Revision: 30687

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=30687
Log:
[svn-upgrade] Integrating new upstream version, libpar-dist-perl (0.44)

Modified:
    branches/upstream/libpar-dist-perl/current/Changes
    branches/upstream/libpar-dist-perl/current/META.yml
    branches/upstream/libpar-dist-perl/current/Makefile.PL
    branches/upstream/libpar-dist-perl/current/lib/PAR/Dist.pm
    branches/upstream/libpar-dist-perl/current/t/03merge_meta.t
    branches/upstream/libpar-dist-perl/current/t/data/dist2.par

Modified: branches/upstream/libpar-dist-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/Changes?rev=30687&op=diff
==============================================================================
--- branches/upstream/libpar-dist-perl/current/Changes (original)
+++ branches/upstream/libpar-dist-perl/current/Changes Sat Feb 14 01:57:46 2009
@@ -1,3 +1,9 @@
+By: smueller on 2009/02/02
+    * Abandon support for perl 5.005.
+    * Merging of the various requires-like META.yml sections in
+      merge_par.
+    * This is 0.44.
+____________________________________________________________________________
 By: smueller on 2009/01/23
     * Don't rely on the return value of ExtUtils::Install::(un)?install
       to indicate success or failure of the (un)?installation.

Modified: branches/upstream/libpar-dist-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/META.yml?rev=30687&op=diff
==============================================================================
--- branches/upstream/libpar-dist-perl/current/META.yml (original)
+++ branches/upstream/libpar-dist-perl/current/META.yml Sat Feb 14 01:57:46 2009
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                PAR-Dist
-version:             0.43
+version:             0.44
 abstract:            Create and manipulate PAR distributions
 license:             ~
 author:              

Modified: branches/upstream/libpar-dist-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/Makefile.PL?rev=30687&op=diff
==============================================================================
--- branches/upstream/libpar-dist-perl/current/Makefile.PL (original)
+++ branches/upstream/libpar-dist-perl/current/Makefile.PL Sat Feb 14 01:57:46 2009
@@ -1,3 +1,4 @@
+use 5.006;
 use ExtUtils::MakeMaker;
 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
 # the contents of the Makefile that is written.

Modified: branches/upstream/libpar-dist-perl/current/lib/PAR/Dist.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/lib/PAR/Dist.pm?rev=30687&op=diff
==============================================================================
--- branches/upstream/libpar-dist-perl/current/lib/PAR/Dist.pm (original)
+++ branches/upstream/libpar-dist-perl/current/lib/PAR/Dist.pm Sat Feb 14 01:57:46 2009
@@ -1,8 +1,10 @@
 package PAR::Dist;
+use 5.006;
+use strict;
 require Exporter;
 use vars qw/$VERSION @ISA @EXPORT @EXPORT_OK $DEBUG/;
 
-$VERSION    = '0.43';
+$VERSION    = '0.44';
 @ISA	    = 'Exporter';
 @EXPORT	    = qw/
   blib_to_par
@@ -23,7 +25,6 @@
 
 $DEBUG = 0;
 
-use strict;
 use Carp qw/carp croak/;
 use File::Spec;
 
@@ -33,7 +34,7 @@
 
 =head1 VERSION
 
-This document describes version 0.43 of PAR::Dist, released January 23, 2009.
+This document describes version 0.44 of PAR::Dist, released February  2, 2009.
 
 =head1 SYNOPSIS
 
@@ -621,7 +622,8 @@
 into the distribution C<foo.par>. C<foo.par> will be overwritten!
 
 The original META.yml of C<foo.par> is retained, but augmented with any
-C<provides> sections from the other C<.par> files.
+C<provides>, C<requires>, C<recommends>, C<build_requires>, and
+C<configure_requires> sections from the other C<.par> files.
 
 =cut
 
@@ -755,12 +757,24 @@
   my $orig_tree  = (ref($orig_meta) eq 'ARRAY' ? $orig_meta->[0] : $orig_meta);
   my $extra_tree = (ref($extra_meta) eq 'ARRAY' ? $extra_meta->[0] : $extra_meta);
 
-  # do nothing if the extra meta has no provides field.
-  return() if not exists $extra_tree->{provides};  
-
-  my $extra_provides = $extra_tree->{provides};
-  $orig_tree->{provides} = {} if not defined $orig_tree->{provides};
-  my $orig_provides = $orig_tree->{provides};
+  _merge_provides($orig_tree, $extra_tree);
+  _merge_requires($orig_tree, $extra_tree);
+  
+  $yaml_functions->{DumpFile}->($meta_orig_file, $orig_meta);
+
+  return 1;
+}
+
+# merge the two-level provides sections of META.yml
+sub _merge_provides {
+  my $orig_hash  = shift;
+  my $extra_hash = shift;
+
+  return() if not exists $extra_hash->{provides};
+  $orig_hash->{provides} ||= {};
+
+  my $orig_provides  = $orig_hash->{provides};
+  my $extra_provides = $extra_hash->{provides};
 
   # two level clone is enough wrt META spec 1.4
   # overwrite the original provides since we're also overwriting the files.
@@ -770,12 +784,24 @@
     $mod_hash{$_} = $extra_mod_hash->{$_} for keys %$extra_mod_hash;
     $orig_provides->{$module} = \%mod_hash;
   }
-  
-  $yaml_functions->{DumpFile}->($meta_orig_file, $orig_meta);
-
-  return 1;
-}
-
+}
+
+# merge the single-level requires-like sections of META.yml
+sub _merge_requires {
+  my $orig_hash  = shift;
+  my $extra_hash = shift;
+
+  foreach my $type (qw(requires build_requires configure_requires recommends)) {
+    next if not exists $extra_hash->{$type};
+    $orig_hash->{$type} ||= {};
+    
+    # one level clone is enough wrt META spec 1.4
+    foreach my $module (keys %{ $extra_hash->{$type} }) {
+      # FIXME there should be a version comparison here, BUT how are we going to do that without a guaranteed version.pm?
+      $orig_hash->{$type}{$module} = $extra_hash->{$type}{$module}; # assign version and module name
+    }
+  }
+}
 
 =head2 remove_man
 

Modified: branches/upstream/libpar-dist-perl/current/t/03merge_meta.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/t/03merge_meta.t?rev=30687&op=diff
==============================================================================
--- branches/upstream/libpar-dist-perl/current/t/03merge_meta.t (original)
+++ branches/upstream/libpar-dist-perl/current/t/03merge_meta.t Sat Feb 14 01:57:46 2009
@@ -1,13 +1,12 @@
 #!/usr/bin/perl -w
 
 use strict;
-use Test;
+use Test::More;
 use vars '$loaded';
-
 
 BEGIN { $loaded = eval { require PAR::Dist; 1 } };
 BEGIN {
-  my $tests = 25;
+  my $tests = 29;
   if ($loaded) {  
     # skip these tests without YAML loader or without (A::Zip or zipo/unzip)
     $PAR::Dist::DEBUG = 1;
@@ -81,6 +80,25 @@
   },
 );
 
+my %requires_expect = (
+  "Math::Symbolic" => '0.507',
+  "Math::Symbolic::Custom::Pattern" => '1.20',
+  "base" =>  '2.11',
+  "namespace::clean" =>  '0.08',
+  "Test::More" => '0',
+);
+
+my %build_requires_expect = (
+  "Test::More" => '0.1',
+  "Test::Differences" => undef,
+);
+
+my %recommends_expect = (
+  "Test::Pod" => '1.0',
+  "Test::Pod::Coverage" => '1.0',
+);
+
+
 PAR::Dist::merge_par(@tmp);
 
 ok(1); # got to this point
@@ -93,7 +111,6 @@
 my $result = $y_func->{Load}->( $meta );
 ok(defined $result);
 $result = $result->[0] if ref($result) eq 'ARRAY';
-use Data::Dumper;
 
 my $provides = $result->{provides};
 ok(ref($provides) eq 'HASH');
@@ -112,5 +129,9 @@
   }
 }
 
+is_deeply($result->{requires}, \%requires_expect, "requires merged as expected");
+is_deeply($result->{build_requires}, \%build_requires_expect, "build_requires merged as expected");
+is_deeply($result->{configure_requires}, undef, "configure_requires merged as expected");
+is_deeply($result->{recommends}, \%recommends_expect, "recommends merged as expected");
 
 __END__

Modified: branches/upstream/libpar-dist-perl/current/t/data/dist2.par
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libpar-dist-perl/current/t/data/dist2.par?rev=30687&op=diff
==============================================================================
Binary files - no diff available.




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