lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject [2/7] git commit: Add a `dist` action for CPAN to CFC Perl build.
Date Tue, 08 Jul 2014 01:18:49 GMT
Add a `dist` action for CPAN to CFC Perl build.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/125a4efa
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/125a4efa
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/125a4efa

Branch: refs/heads/prep_cpan_dist_for_0.4.0
Commit: 125a4efad5691694f8b349ebf8a2b6ab02f58c08
Parents: 8055a73
Author: Marvin Humphrey <marvin@rectangular.com>
Authored: Mon Jul 7 12:44:52 2014 -0700
Committer: Marvin Humphrey <marvin@rectangular.com>
Committed: Mon Jul 7 17:48:42 2014 -0700

----------------------------------------------------------------------
 compiler/perl/buildlib/Clownfish/CFC/Build.pm | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/125a4efa/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build.pm b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
index 8de7c9c..0eeb1db 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
@@ -25,6 +25,8 @@ use base qw( Clownfish::CFC::Perl::Build::Charmonic );
 no lib 'lib';
 
 use File::Spec::Functions qw( catfile updir catdir curdir );
+use File::Copy qw( move );
+use File::Path qw( rmtree );
 use Config;
 use Cwd qw( getcwd );
 use Carp;
@@ -167,5 +169,37 @@ sub ACTION_code {
     $self->SUPER::ACTION_code;
 }
 
+sub ACTION_dist {
+    my $self = shift;
+
+    # We build our Perl release tarball from a subdirectory rather than from
+    # the top-level $REPOS_ROOT.  Because some assets we need are outside this
+    # directory, we need to copy them in.
+    my %to_copy = (
+        '../../CONTRIBUTING' => 'CONTRIBUTING',
+        '../../LICENSE'      => 'LICENSE',
+        '../../NOTICE'       => 'NOTICE',
+        '../../README'       => 'README',
+        '../../lemon'        => 'lemon',
+        '../src'             => 'src',
+        '../include'         => 'include',
+        $CHARMONIZER_C       => 'charmonizer.c',
+    );
+    print "Copying files...\n";
+    while (my ($from, $to) = each %to_copy) {
+        confess("'$to' already exists") if -e $to;
+        system("cp -R $from $to") and confess("cp failed");
+    }
+    move( "MANIFEST", "MANIFEST.bak" ) or die "move() failed: $!";
+    $self->depends_on("manifest");
+    $self->SUPER::ACTION_dist;
+
+    # Now that the tarball is packaged up, delete the copied assets.
+    rmtree($_) for values %to_copy;
+    unlink("META.yml");
+    unlink("META.json");
+    move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
+}
+
 1;
 


Mime
View raw message