+6.10_05 Fri Jun 6 18:15:30 PDT 2003
+ * Documenting META.yml, NO_META
+ * Documenting the fact that distdir will auto generate META.yml and
+ alter your manifest.
+ * Adding META.yml autogeneration to the FAQ
+ - Recognizing comments with leading whitespace in MANIFESTs better.
+ - Small ExtUtils::Liblist::Kid problem on VMS (Craig Berry)
+ * Fixed "make install UNINST=1". Appears to have been broken somewhere
+ around 6.06_01.
+ - Documented the fourth argument to ExtUtils::Install::install()
+ - install() will now honor a PERL5LIB change between ExtUtils::Install
+ loading and install() running when uninstalling shadows.
+ - META.yml generation deals gracefully when the MANIFEST is read-only
+ (Slaven rt.cpan.org 2723)
+ - Fixing tests on limited dir depth VMS systems by moving the
+ dummy-install dir one level up (Craig Berry rt.cpan.org 2747)
+
6.10_04 Fri May 23 01:13:04 PDT 2003
- Working around BSD threaading bug in version check. [from bleadperl]
- Added the Makefile to the dist dependencies. (Slaven Rezic)
$Is_MacPerl = $^O eq 'MacOS';
my $splitchar = $^O eq 'VMS' ? '|' : ($^O eq 'os2' || $^O eq 'dos') ? ';' : ':';
-my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'} ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
my $Inc_uninstall_warn_handler;
# install relative to here
=item B<install>
install(\%from_to);
- install(\%from_to, $verbose, $dont_execute);
+ install(\%from_to, $verbose, $dont_execute, $uninstall_shadows);
Copies each directory tree of %from_to to its corresponding value
preserving timestamps and permissions.
directory than the one where the files later appear.
If $verbose is true, will print out each file removed. Default is
-false.
+false. This is "make install VERBINST=1"
If $dont_execute is true it will only print what it was going to do
without actually doing it. Default is false.
+If $uninstall_shadows is true any differing versions throughout @INC
+will be uninstalled. This is "make install UNINST=1"
+
=cut
sub install {
find(sub {
my ($mode,$size,$atime,$mtime) = (stat)[2,7,8,9];
return unless -f _;
- return if $_ eq ".exists";
+
+ my $origfile = $_;
+ return if $origfile eq ".exists";
my $targetdir = File::Spec->catdir($targetroot, $File::Find::dir);
- my $targetfile = File::Spec->catfile($targetdir, $_);
+ my $targetfile = File::Spec->catfile($targetdir, $origfile);
my $sourcedir = File::Spec->catdir($source, $File::Find::dir);
- my $sourcefile = File::Spec->catfile($sourcedir, $_);
+ my $sourcefile = File::Spec->catfile($sourcedir, $origfile);
my $save_cwd = cwd;
chdir $cwd; # in case the target is relative
}
sub inc_uninstall {
- my($file,$libdir,$verbose,$nonono) = @_;
+ my($filepath,$libdir,$verbose,$nonono) = @_;
my($dir);
+ my $file = (File::Spec->splitpath($filepath))[2];
my %seen_dir = ();
+
+ my @PERL_ENV_LIB = split $splitchar, defined $ENV{'PERL5LIB'}
+ ? $ENV{'PERL5LIB'} : $ENV{'PERLLIB'} || '';
+
foreach $dir (@INC, @PERL_ENV_LIB, @Config{qw(archlibexp
privlibexp
sitearchexp
# know, which is the file we just installed (AFS). So we leave
# an identical file in place
my $diff = 0;
- if ( -f $targetfile && -s _ == -s $file) {
+ if ( -f $targetfile && -s _ == -s $filepath) {
# We have a good chance, we can skip this one
- $diff = compare($file,$targetfile);
+ $diff = compare($filepath,$targetfile);
} else {
print "#$file and $targetfile differ\n" if $verbose>1;
$diff++;
sub run_filter {
my ($cmd, $src, $dest) = @_;
+ local(*CMD, *SRC);
open(CMD, "|$cmd >$dest") || die "Cannot fork: $!";
open(SRC, $src) || die "Cannot open $src: $!";
my $buf;
use 5.00503;
# Broken out of MakeMaker from version 4.11
+use strict;
use vars qw($VERSION);
$VERSION = 1.30;
$lib = $libmap{$lib};
}
- my(@variants,$variant,$name,$test,$cand);
+ my(@variants,$variant,$cand);
my($ctype) = '';
# If we don't have a file type, consider it a possibly abbreviated name and
push(@variants,$lib);
warn "Looking for $lib\n" if $verbose;
foreach $variant (@variants) {
+ my($fullname, $name);
+
foreach $dir (@dirs) {
my($type);
$name = "$dir$variant";
warn "\tChecking $name\n" if $verbose > 2;
- if (-f ($test = VMS::Filespec::rmsexpand($name))) {
+ $fullname = VMS::Filespec::rmsexpand($name);
+ if (defined $fullname and -f $fullname) {
# It's got its own suffix, so we'll have to figure out the type
- if ($test =~ /(?:$so|exe)$/i) { $type = 'SHR'; }
- elsif ($test =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
- elsif ($test =~ /(?:$obj_ext|obj)$/i) {
+ if ($fullname =~ /(?:$so|exe)$/i) { $type = 'SHR'; }
+ elsif ($fullname =~ /(?:$lib_ext|olb)$/i) { $type = 'OLB'; }
+ elsif ($fullname =~ /(?:$obj_ext|obj)$/i) {
warn "Note (probably harmless): "
- ."Plain object file $test found in library list\n";
+ ."Plain object file $fullname found in library list\n";
$type = 'OBJ';
}
else {
warn "Note (probably harmless): "
- ."Unknown library type for $test; assuming shared\n";
+ ."Unknown library type for $fullname; assuming shared\n";
$type = 'SHR';
}
}
- elsif (-f ($test = VMS::Filespec::rmsexpand($name,$so)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.exe'))) {
+ elsif (-f ($fullname = VMS::Filespec::rmsexpand($name,$so)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.exe'))) {
$type = 'SHR';
- $name = $test unless $test =~ /exe;?\d*$/i;
+ $name = $fullname unless $fullname =~ /exe;?\d*$/i;
}
- elsif (not length($ctype) and # If we've got a lib already, don't bother
- ( -f ($test = VMS::Filespec::rmsexpand($name,$lib_ext)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.olb')))) {
+ elsif (not length($ctype) and # If we've got a lib already,
+ # don't bother
+ ( -f ($fullname = VMS::Filespec::rmsexpand($name,$lib_ext)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.olb')))) {
$type = 'OLB';
- $name = $test unless $test =~ /olb;?\d*$/i;
+ $name = $fullname unless $fullname =~ /olb;?\d*$/i;
}
- elsif (not length($ctype) and # If we've got a lib already, don't bother
- ( -f ($test = VMS::Filespec::rmsexpand($name,$obj_ext)) or
- -f ($test = VMS::Filespec::rmsexpand($name,'.obj')))) {
+ elsif (not length($ctype) and # If we've got a lib already,
+ # don't bother
+ ( -f ($fullname = VMS::Filespec::rmsexpand($name,$obj_ext)) or
+ -f ($fullname = VMS::Filespec::rmsexpand($name,'.obj')))) {
warn "Note (probably harmless): "
- ."Plain object file $test found in library list\n";
+ ."Plain object file $fullname found in library list\n";
$type = 'OBJ';
- $name = $test unless $test =~ /obj;?\d*$/i;
+ $name = $fullname unless $fullname =~ /obj;?\d*$/i;
}
if (defined $type) {
$ctype = $type; $cand = $name;
# This has to precede any other CRTLs, so just make it first
if ($cand eq 'VAXCCURSE') { unshift @{$found{$ctype}}, $cand; }
else { push @{$found{$ctype}}, $cand; }
- warn "\tFound as $cand (really $test), type $ctype\n" if $verbose > 1;
+ warn "\tFound as $cand (really $fullname), type $ctype\n"
+ if $verbose > 1;
push @flibs, $name unless $libs_seen{$fullname}++;
next LIB;
}
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX#
name: ExtUtils-MakeMaker
-version: 6.10_04
+version: 6.10_05
version_from: lib/ExtUtils/MakeMaker.pm
installdirs: perl
requires:
Pod::Man: 0
distribution_type: module
-generated_by: ExtUtils::MakeMaker version 6.10_04
+generated_by: ExtUtils::MakeMaker version 6.10_05
MAKE_FRAG
my $add_meta = $self->oneliner(<<'CODE', ['-MExtUtils::Manifest=maniadd']);
-maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}});
+eval { maniadd({q{META.yml} => q{Module meta-data (added by MakeMaker)}}) }
+ or warn "Could not add META.yml to MANIFEST: $@\n"
CODE
return sprintf <<'MAKE_FRAG', $add_meta;
warn "Can't create new $file: $!\n";
next;
}
- my($dev,$ino,$mode) = stat FIXIN;
# Print out the new #! line (or equivalent).
local $\;
BEGIN {require 5.005_03;}
-$VERSION = '6.10_04';
-($Revision) = q$Revision: 1.111 $ =~ /Revision:\s+(\S+)/;
+$VERSION = '6.10_05';
+($Revision) = q$Revision: 1.115 $ =~ /Revision:\s+(\S+)/;
require Exporter;
use Config;
Boolean. Attribute to inhibit descending into subdirectories.
+=item NO_META
+
+When true, suppresses the generation and addition to the MANIFEST of
+the META.yml module meta-data file during 'make distdir'.
+
+Defaults to false.
+
=item NO_VC
In general, any generated Makefile checks for the current version of
$VERSION = '1.00';
*VERSION = \'1.01';
- $VERSION = sprintf "%d.%03d", q$Revision: 1.111 $ =~ /(\d+)/g;
+ $VERSION = sprintf "%d.%03d", q$Revision: 1.115 $ =~ /(\d+)/g;
$FOO::VERSION = '1.10';
*FOO::VERSION = \'1.11';
our $VERSION = 1.2.3; # new for perl5.6.0
directory with the name C<$(DISTNAME)-$(VERSION)>. If that directory
exists, it will be removed first.
+Additionally, it will create a META.yml module meta-data file and add
+this to your MANFIEST. You can shut this behavior off with the NO_META
+flag.
+
=item make disttest
Makes a distdir first, and runs a C<perl Makefile.PL>, a make, and
WriteMakefile( 'dist' => { COMPRESS=>"bzip2", SUFFIX=>".bz2" })
+
+=head2 Module Meta-Data
+
+Long plaguing users of MakeMaker based modules has been the problem of
+getting basic information about the module out of the sources
+I<without> running the F<Makefile.PL> and doing a bunch of messy
+heuristics on the resulting F<Makefile>. To this end a simple module
+meta-data file has been introduced, F<META.yml>.
+
+F<META.yml> is a YAML document (see http://www.yaml.org) containing
+basic information about the module (name, version, prerequisites...)
+in an easy to read format. The format is developed and defined by the
+Module::Build developers.
+
+MakeMaker will automatically generate a F<META.yml> file for you and
+add it to your F<MANIFEST> as part of the 'distdir' target (and thus
+the 'dist' target). This is intended to seamlessly and rapidly
+populate CPAN with module meta-data. If you wish to shut this feature
+off, set the C<NO_META> C<WriteMakefile()> flag to true.
+
+
=head2 Disabling an extension
If some events detected in F<Makefile.PL> imply that there is no way
local $_;
while (<M>){
chomp;
- next if /^#/;
+ next if /^\s*#/;
my($file, $comment) = /^(\S+)\s*(.*)/;
next unless $file;
maniadd({ $file => $comment, ...});
-Adds an entry to an existing F<MANIFEST>.
+Adds an entry to an existing F<MANIFEST> unless its already there.
$file will be normalized (ie. Unixified). B<UNIMPLEMENTED>
my $manifest = maniread();
open(MANIFEST, ">>$MANIFEST") or die "Could not open $MANIFEST: $!";
foreach my $file (_sort keys %$additions) {
+ next if exists $manifest->{$file};
+
my $comment = $additions->{$file} || '';
- printf MANIFEST "%-40s%s\n", $file, $comment unless
- exists $manifest->{$file};
+ printf MANIFEST "%-40s%s\n", $file, $comment;
}
close MANIFEST;
}
Eliminate eliminate_macros() from inside FS::VMS->catfile and catdir.
Make into MM_VMS wrappers.
-Add "NO_META" to stop autogeneration (and auto overwrite) of META.yml.
-
Test ExtUtils::Command::MM
Finish ExtUtils::MakeMaker::Tutorial
Add target to generate native VMS help files.
-Add "What's this META.yml thing?" to the FAQ.
-
On VMS, write PM_FILTERs to a temp file and run from there avoiding command
-line lengths.
+line lengths. Worth the trouble given the Unixy nature of PM_FILTER?
Move oneliner() and friends into a seperate module for general consumption.
Make out of date check on 'make dist' more useful
http://archive.develooper.com/makemaker@perl.org/msg01075.html
+
+Make maniadd() return a tied, case-insensitive hash on VMS.
foreach my $file (@modules) {
# 5.8.0 has a bug about require alone in an eval. Thus the extra
# statement.
- eval q{ require($file); 1 };
+ eval { require($file); 1 };
is( $@, '', "require $file" );
SKIP: {
use File::Path;
use File::Spec;
-use Test::More tests => 21;
+use Test::More tests => 29;
BEGIN { use_ok('ExtUtils::Install') }
pm_to_blib( { 'lib/Big/Dummy.pm' => 'blib/lib/Big/Dummy.pm' },
'blib/lib/auto'
);
+END { rmtree 'blib' }
+
ok( -d 'blib/lib', 'pm_to_blib created blib dir' );
ok( -r 'blib/lib/Big/Dummy.pm', ' copied .pm file' );
ok( -r 'blib/lib/auto', ' created autosplit dir' );
is( keys %packlist, 1 );
is( lc((keys %packlist)[0]), lc $native_dummy, 'packlist written' );
-END { rmtree 'blib' }
+
+# Test UNINST=1 preserving same versions in other dirs.
+install( { 'blib/lib' => 'install-test/other_lib/perl',
+ read => 'install-test/packlist',
+ write => 'install-test/packlist'
+ },
+ 0, 0, 1);
+ok( -d 'install-test/other_lib/perl', 'install made other dir' );
+ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
+ok( -r 'install-test/packlist', ' packlist exists' );
+ok( -r 'install-test/lib/perl/Big/Dummy.pm', ' UNINST=1 preserved same' );
+
+
+
+# Test UNINST=1 removing other versions in other dirs.
+chmod 0644, 'blib/lib/Big/Dummy.pm' or die $!;
+open(DUMMY, ">>blib/lib/Big/Dummy.pm") or die $!;
+print DUMMY "Extra stuff\n";
+close DUMMY;
+
+{
+ local @INC = ('install-test/lib/perl');
+ local $ENV{PERL5LIB} = '';
+ install( { 'blib/lib' => 'install-test/other_lib/perl',
+ read => 'install-test/packlist',
+ write => 'install-test/packlist'
+ },
+ 0, 0, 1);
+ ok( -d 'install-test/other_lib/perl', 'install made other dir' );
+ ok( -r 'install-test/other_lib/perl/Big/Dummy.pm', ' .pm file installed' );
+ ok( -r 'install-test/packlist', ' packlist exists' );
+ ok( !-r 'install-test/lib/perl/Big/Dummy.pm',
+ ' UNINST=1 removed different' );
+}
use strict;
use Config;
-use Test::More tests => 52;
+use Test::More tests => 54;
use MakeMaker::Test::Utils;
use File::Find;
use File::Spec;
ok( chdir 'Big-Dummy', "chdir'd to Big-Dummy" ) ||
diag("chdir failed: $!");
-my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=dummy-install"});
+my @mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) ||
diag(@mpl_out);
like( $install_out, qr/^Installing /m );
like( $install_out, qr/^Writing /m );
-ok( -r 'dummy-install', ' install dir created' );
+ok( -r '../dummy-install', ' install dir created' );
my %files = ();
find( sub {
# do it case-insensitive for non-case preserving OSs
$files{lc $_} = $File::Find::name;
-}, 'dummy-install' );
+}, '../dummy-install' );
ok( $files{'dummy.pm'}, ' Dummy.pm installed' );
ok( $files{'liar.pm'}, ' Liar.pm installed' );
ok( $files{'.packlist'}, ' packlist created' );
is( $?, 0, 'metafile' ) || diag($metafile_out);
ok( !-f 'META.yml', 'META.yml generation suppressed by NO_META' );
+# Test if MANIFEST is read-only.
+chmod 0444, 'MANIFEST';
+@mpl_out = run(qq{$perl Makefile.PL});
+cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
+$metafile_out = run("$make metafile_addtomanifest");
+is( $?, 0, q{metafile_addtomanifest didn't die with locked MANIFEST} ) ||
+ diag($metafile_out);
+
# Make sure init_dirscan doesn't go into the distdir
-@mpl_out = run(qq{$perl Makefile.PL "PREFIX=dummy-install"});
+@mpl_out = run(qq{$perl Makefile.PL "PREFIX=../dummy-install"});
cmp_ok( $?, '==', 0, 'Makefile.PL exited with zero' ) || diag(@mpl_out);
use strict;
-use Test::More tests => 2;
+use Test::More tests => 3;
use File::Path;
rmtree('Big-Dummy');
ok(!-d 'Big-Dummy', 'Big-Dummy cleaned up');
rmtree('Problem-Module');
ok(!-d 'Problem-Module', 'Problem-Module cleaned up');
+rmtree('dummy-install');
+ok(!-d 'dummy-install', 'dummy-install cleaned up');