lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From the...@apache.org
Subject [lucy-commits] svn commit: r1296757 - /incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm
Date Sun, 04 Mar 2012 06:33:14 GMT
Author: theory
Date: Sun Mar  4 06:33:14 2012
New Revision: 1296757

URL: http://svn.apache.org/viewvc?rev=1296757&view=rev
Log:
Make sure all provided modules have a version.
    
And that it is also the correct version.a

Modified:
    incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm

Modified: incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm
URL: http://svn.apache.org/viewvc/incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm?rev=1296757&r1=1296756&r2=1296757&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm Sun Mar  4 06:33:14 2012
@@ -727,6 +727,24 @@ sub ACTION_dist {
     move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
 }
 
+sub ACTION_distmeta {
+    my $self = shift;
+    $self->SUPER::ACTION_distmeta(@_);
+    # Make sure everything has a version.
+    require CPAN::Meta;
+    my $v = version->new($self->dist_version);
+    my $meta = CPAN::Meta->load_file('META.json');
+    my $provides = $meta->provides;
+    while (my ($pkg, $data) = each %{ $provides }) {
+        die "$pkg, defined in $data->{file}, has no version\n"
+            unless $data->{version};
+        die "$pkg, defined in $data->{file}, is "
+            . version->new($data->{version})->normal
+            . " but should be " . $v->normal . "\n"
+            unless $data->{version} == $v;
+    }
+}
+
 # Generate a list of files for PAUSE, search.cpan.org, etc to ignore.
 sub _gen_pause_exclusion_list {
     my $self = shift;



Mime
View raw message