You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2012/02/15 04:13:49 UTC

[lucy-commits] svn commit: r1244324 - /incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm

Author: marvin
Date: Wed Feb 15 03:13:48 2012
New Revision: 1244324

URL: http://svn.apache.org/viewvc?rev=1244324&view=rev
Log:
Detect changes in the Perl bindings and recompile.

Recompile as necessary when files which affect the Perl bindings have changed.
(This used to be the .pm files in perl/lib/ but it's now the .pm files in
perl/buildlib/.)

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=1244324&r1=1244323&r2=1244324&view=diff
==============================================================================
--- incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm (original)
+++ incubator/lucy/trunk/perl/buildlib/Lucy/Build.pm Wed Feb 15 03:13:48 2012
@@ -232,7 +232,6 @@ sub _compile_clownfish {
 
     # Process all __BINDING__ blocks.
     my $pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
-    my @pm_filepaths_with_xs;
     for my $pm_filepath (@$pm_filepaths) {
         next unless $pm_filepath =~ /Binding/;
         require $pm_filepath;
@@ -251,7 +250,7 @@ sub _compile_clownfish {
         footer     => '',
     );
 
-    return ( $hierarchy, $binding, \@pm_filepaths_with_xs );
+    return ( $hierarchy, $binding );
 }
 
 sub ACTION_pod {
@@ -301,21 +300,20 @@ sub ACTION_clownfish {
     }
     $self->add_to_cleanup($AUTOGEN_DIR);
 
-    my $pm_filepaths  = $self->rscan_dir( $LIB_DIR,         qr/\.pm$/ );
+    my $buildlib_pm_filepaths = $self->rscan_dir( $BUILDLIB_DIR, qr/\.pm$/ );
     my $cfh_filepaths = $self->rscan_dir( $CORE_SOURCE_DIR, qr/\.cfh$/ );
 
     # XXX joes thinks this is dubious
     # Don't bother parsing Clownfish files if everything's up to date.
     return
         if $self->up_to_date(
-        [ @$cfh_filepaths, @$pm_filepaths ],
+        [ @$cfh_filepaths, @$buildlib_pm_filepaths ],
         [ $XS_FILEPATH,    $AUTOGEN_DIR, ]
         );
 
     # Write out all autogenerated files.
     print "Parsing Clownfish files...\n";
-    my ( $hierarchy, $perl_binding, $pm_filepaths_with_xs )
-        = $self->_compile_clownfish;
+    my ( $hierarchy, $perl_binding ) = $self->_compile_clownfish;
     require Clownfish::CFC::Binding::Core;
     my $core_binding = Clownfish::CFC::Binding::Core->new(
         hierarchy => $hierarchy,
@@ -334,7 +332,7 @@ sub ACTION_clownfish {
 
     # Rewrite XS if either any .cfh files or relevant .pm files were modified.
     $modified ||=
-        $self->up_to_date( \@$pm_filepaths_with_xs, $XS_FILEPATH )
+        $self->up_to_date( \@$buildlib_pm_filepaths, $XS_FILEPATH )
         ? 0
         : 1;
 
@@ -350,14 +348,14 @@ sub ACTION_clownfish {
     # and didn't trigger a rewrite, so that we won't have to check them again
     # next pass.
     if (!$self->up_to_date(
-            [ @$cfh_filepaths, @$pm_filepaths_with_xs ], $XS_FILEPATH
+            [ @$cfh_filepaths, @$buildlib_pm_filepaths ], $XS_FILEPATH
         )
         )
     {
         utime( time, time, $XS_FILEPATH );    # touch
     }
     if (!$self->up_to_date(
-            [ @$cfh_filepaths, @$pm_filepaths_with_xs ], $AUTOGEN_DIR
+            [ @$cfh_filepaths, @$buildlib_pm_filepaths ], $AUTOGEN_DIR
         )
         )
     {