Skip to content

Commit

Permalink
Added MANIFEST handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Leont committed Jul 28, 2010
1 parent 4693475 commit 348787d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -10,7 +10,7 @@ perl++/source/evaluate.C
test.out
Build
MYMETA.yml
libperl++-*.tar.bz2
libperl++-*.tar.gz
examples/combined
examples/game
examples/Extend.so
Expand Down
6 changes: 3 additions & 3 deletions MANIFEST
Expand Up @@ -19,8 +19,8 @@ examples/Extend.C
examples/extend.pl
examples/Extend.pm
examples/game.C
inc/Library/Build/PL.pm
inc/Library/Build.pm
inc/Library/Build/PL.pm
inc/Perlpp/Build.pm
lib/Perlpp/Extend.pm
MANIFEST
Expand Down Expand Up @@ -72,7 +72,7 @@ t/50-binds.C
t/50-function-exports.C
t/50-method-exports.C
t/50-tie.C
tap++/headers/tap++.h
tap++/source/tap++.C
t/pod-coverage.t
t/pod.t
tap++/headers/tap++.h
tap++/source/tap++.C
14 changes: 14 additions & 0 deletions MANIFEST.SKIP
@@ -0,0 +1,14 @@
^_build
^Build$
^blib
~$
\.bak$
^MANIFEST\.SKIP$
(^|/)\.
libperl\+\+-.*.tar.gz
^t/.0-.*\.t$
^MYMETA.yml$
^perl\+\+/headers/config.h$
^perl\+\+/headers/extend.h$
^perl\+\+/source/evaluate.C$
^ppport.h$
19 changes: 14 additions & 5 deletions inc/Library/Build.pm
Expand Up @@ -12,6 +12,7 @@ use Carp 'croak';
use Config;
use ExtUtils::CBuilder;
use ExtUtils::Install qw/install/;
use ExtUtils::Manifest qw/maniread manicheck mkmanifest/;
use File::Basename qw/dirname/;
use File::Copy qw/copy/;
use File::Find qw/find/;
Expand Down Expand Up @@ -255,14 +256,22 @@ my %default_actions = (
dist => sub {
my $builder = shift;
$builder->dispatch('build');
$builder->dispatch('manifest') if not -f 'MANIFEST';
my $arch = Archive::Tar->new;
open my $file, '<', 'MANIFEST';
my @files = map { chomp; $_ } <$file>;
close $file;
my $manifest = maniread() or croak 'No MANIFEST found';
my @files = keys %{$manifest};
$arch->add_files(@files);
$_->mode($_->mode & ~022) for $arch->get_files;
my $release_name = $builder->name . '-' . $builder->version;
print "tar xjf $release_name.tar.bz2 @files\n" if $builder->quiet <= 0;
$arch->write("$release_name.tar.bz2", COMPRESS_BZIP, $release_name);
print "tar xjf $release_name.tar.gz @files\n" if $builder->quiet <= 0;
$arch->write("$release_name.tar.gz", COMPRESS_GZIP, $release_name);
},
manifest => sub {
mkmanifest();
},
distcheck => sub {
my @missing = manicheck();
croak "Missing files @missing" if @missing;
},
help => sub {
my $builder = shift;
Expand Down

0 comments on commit 348787d

Please sign in to comment.