Commit 5686e89b authored by gregor herrmann's avatar gregor herrmann

New upstream version 1.5111

parent d97b4150
Version 1.5111:
- Ensure that temp file is created in temp dir
- Fix Makefile.PL warning
- Fix deleting of inc during release process
- Better fix for AutomatedTester warning
Version 1.5110:
- Updating META.yml
Version 1.5109:
- Switch to File::Slurper
Version 1.5108:
- Trying once again to fix the compile test on windows
Version 1.5107:
- Check in standard tests, including one that skips the compile check on Windows
Version 1.5106:
- Add standard tests
- Detect mailboxes that contain a mix of newline types. Complain about it, but
also allow the force option to continue processing. Thanks to Pali Rohár
<pali.rohar@gmail.com> for the bug report.
- Avoid OO interface to File::Temp, which in some versions and on some operating
systems, deletes the file when it is closed. Thanks to Paul Howarth
<paul@city-fan.org> for the bug report.
https://rt.cpan.org/Public/Bug/Display.html?id=103835
- Fix compatibility issue with newer versions of perl, which remove "." from
@INC. https://rt.cpan.org/Ticket/Display.html?id=121466
Version 1.5105: Sat May 2 2015
- Prevent CPAN from indexing private-lib
......
This software is Copyright (c) 2015 by David Coppit.
This software is Copyright (c) 2018 by David Coppit.
This is free software, licensed under:
......
......@@ -50,7 +50,6 @@ t/mailboxes/separators1.sep
t/mailboxes/separators2.sep
t/number.t
t/offset.t
t/pod.t
t/prologue.t
t/reset.t
t/separators.t
......@@ -128,6 +127,7 @@ t/results/reset_newlines_at_beginning.stdout
#t/results/reset_mailbox with space.stdout
# Module::Install extensions
inc/File/Slurper.pm
inc/Module/Install.pm
inc/Module/Install/AutoLicense.pm
inc/Module/Install/AutomatedTester.pm
......@@ -141,13 +141,15 @@ inc/Module/Install/GithubMeta.pm
inc/Module/Install/Include.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
inc/Sort/Versions.pm
inc/Module/Install/PRIVATE/Add_Test_Target.pm
inc/Module/Install/PRIVATE/Configure_Programs.pm
inc/Module/Install/PRIVATE/Enable_Verbose_CPAN_Testing.pm
inc/Module/Install/PRIVATE/Fix_Sort_Versions.pm
inc/Module/Install/StandardTests.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
inc/Sort/Versions.pm
inc/URI/Escape.pm
# Private Module::Install extensions
private-lib/Module/Install/PRIVATE/Add_Test_Target.pm
......
......@@ -5,16 +5,16 @@ author:
build_requires:
ExtUtils::MakeMaker: 6.36
File::Path: 2.08
File::Slurp: 0
Test::Compile: 0
Test::More: 0
Text::Diff: 0
UNIVERSAL::require: 0
configure_requires:
ExtUtils::MakeMaker: 6.36
File::Slurp: 0
URI::Escape: 0
distribution_type: module
dynamic_config: 1
generated_by: 'Module::Install version 1.14'
generated_by: 'Module::Install version 1.19'
license: gpl2
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -35,4 +35,4 @@ resources:
homepage: https://github.com/coppit/mail-mbox-messageparser
license: http://opensource.org/licenses/gpl-2.0.php
repository: https://github.com/coppit/mail-mbox-messageparser
version: '1.5105'
version: '1.5111'
......@@ -5,9 +5,9 @@ use strict;
# For PRIVATE Module::Install extensions
use lib 'private-lib';
use lib '.';
use inc::Module::Install;
use Module::Install::GetProgramLocations;
use File::Slurp;
BEGIN {
my $commands = q{$(CP) t/mailboxes/*\\ * $(DISTVNAME)/t/mailboxes; $(CP) t/results/*\\ * $(DISTVNAME)/t/results};
......@@ -25,8 +25,12 @@ all_from('lib/Mail/Mbox/MessageParser.pm');
auto_set_bugtracker;
githubmeta;
# Perl 5.6 doesn't work with URI::Escape. We get an error about Exporter not exporting "import"
perl_version '5.008';
configure_requires(
'File::Slurp' => 0,
# Module::Install::Bugtracker needs this
'URI::Escape' => 0,
);
requires(
......@@ -35,7 +39,8 @@ requires(
);
test_requires(
'File::Slurp' => 0,
'Test::Compile' => 0,
'File::Slurper' => 0,
'Test::More' => 0,
'Text::Diff' => 0,
'File::Path' => 2.08,
......@@ -49,12 +54,43 @@ Add_Test_Target('testspeed', 't/speed.pl');
configure_programs();
license 'gpl2';
use_standard_tests;
auto_license(holder => 'David Coppit');
no_index 'directory' => 'private-lib';
enable_verbose_cpan_testing();
WriteAll();
realclean_files('inc');
WriteAll;
# ---- Workaround for broken module ----
# https://rt.cpan.org/Ticket/Display.html?id=125772
{
package Module::Install::StandardTests;
sub write_standard_test_compile {
my $self = shift;
$self->write_test_file('000_standard__compile.t', q/
BEGIN {
if ($^O eq 'MSWin32') {
require Test::More;
Test::More->import(skip_all =>
"Test::Compile doesn't work properly on Windows");
} else {
require Test::More;
Test::More->import();
eval "use Test::Compile";
Test::More->builder->BAIL_OUT(
"Test::Compile required for testing compilation") if $@;
all_pm_files_ok();
}
}
/);
}
}
fix_sort_versions('inc/Sort/Versions.pm');
#!/usr/bin/perl -w
#!/usr/bin/perl
$VERSION = '1.00';
use strict;
use warnings;
use FileHandle;
#-------------------------------------------------------------------------------
......
#line 1
package File::Slurper;
$File::Slurper::VERSION = '0.012';
use strict;
use warnings;
use Carp 'croak';
use Exporter 5.57 'import';
use Encode 2.11 qw/FB_CROAK STOP_AT_PARTIAL/;
use PerlIO::encoding;
our @EXPORT_OK = qw/read_binary read_text read_lines write_binary write_text read_dir/;
sub read_binary {
my $filename = shift;
# This logic is a bit ugly, but gives a significant speed boost
# because slurpy readline is not optimized for non-buffered usage
open my $fh, '<:unix', $filename or croak "Couldn't open $filename: $!";
if (my $size = -s $fh) {
my $buf;
my ($pos, $read) = 0;
do {
defined($read = read $fh, ${$buf}, $size - $pos, $pos) or croak "Couldn't read $filename: $!";
$pos += $read;
} while ($read && $pos < $size);
return ${$buf};
}
else {
return do { local $/; <$fh> };
}
}
use constant {
CRLF_DEFAULT => $^O eq 'MSWin32',
HAS_UTF8_STRICT => scalar do { local $@; eval { require PerlIO::utf8_strict } },
};
sub _text_layers {
my ($encoding, $crlf) = @_;
$crlf = CRLF_DEFAULT if $crlf && $crlf eq 'auto';
if (HAS_UTF8_STRICT && $encoding =~ /^utf-?8\b/i) {
return $crlf ? ':unix:utf8_strict:crlf' : ':unix:utf8_strict';
}
else {
# non-ascii compatible encodings such as UTF-16 need encoding before crlf
return $crlf ? ":raw:encoding($encoding):crlf" : ":raw:encoding($encoding)";
}
}
sub read_text {
my ($filename, $encoding, $crlf) = @_;
$encoding ||= 'utf-8';
my $layer = _text_layers($encoding, $crlf);
local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK;
open my $fh, "<$layer", $filename or croak "Couldn't open $filename: $!";
return do { local $/; <$fh> };
}
sub write_text {
my ($filename, undef, $encoding, $crlf) = @_;
$encoding ||= 'utf-8';
my $layer = _text_layers($encoding, $crlf);
local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK;
open my $fh, ">$layer", $filename or croak "Couldn't open $filename: $!";
print $fh $_[1] or croak "Couldn't write to $filename: $!";
close $fh or croak "Couldn't write to $filename: $!";
return;
}
sub write_binary {
my $filename = $_[0];
open my $fh, ">:raw", $filename or croak "Couldn't open $filename: $!";
print $fh $_[1] or croak "Couldn't write to $filename: $!";
close $fh or croak "Couldn't write to $filename: $!";
return;
}
sub read_lines {
my ($filename, $encoding, $crlf, $skip_chomp) = @_;
$encoding ||= 'utf-8';
my $layer = _text_layers($encoding, $crlf);
local $PerlIO::encoding::fallback = STOP_AT_PARTIAL | FB_CROAK;
open my $fh, "<$layer", $filename or croak "Couldn't open $filename: $!";
return <$fh> if $skip_chomp;
my @buf = <$fh>;
close $fh;
chomp @buf;
return @buf;
}
sub read_dir {
my ($dirname) = @_;
opendir my ($dir), $dirname or croak "Could not open $dirname: $!";
return grep { not m/ \A \.\.? \z /x } readdir $dir;
}
1;
# ABSTRACT: A simple, sane and efficient module to slurp a file
__END__
#line 206
......@@ -8,7 +8,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
}
# special map on pre-defined feature sets
......@@ -537,7 +537,7 @@ sub _install_cpan {
while ( my ( $opt, $arg ) = splice( @config, 0, 2 ) ) {
( $args{$opt} = $arg, next )
if $opt =~ /^(?:force|notest)$/; # pseudo-option
$CPAN::Config->{$opt} = $arg;
$CPAN::Config->{$opt} = $opt eq 'urllist' ? [$arg] : $arg;
}
if ($args{notest} && (not CPAN::Shell->can('notest'))) {
......
......@@ -31,7 +31,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '1.14';
$VERSION = '1.19';
# Storage for the pseudo-singleton
$MAIN = undef;
......@@ -244,6 +244,8 @@ sub new {
}
return $args{_self} if $args{_self};
$base_path = VMS::Filespec::unixify($base_path) if $^O eq 'VMS';
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
......@@ -322,7 +324,7 @@ sub find_extensions {
my ($self, $path) = @_;
my @found;
File::Find::find( sub {
File::Find::find( {no_chdir => 1, wanted => sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
......@@ -336,7 +338,7 @@ sub find_extensions {
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
my $content = Module::Install::_read($subpath . '.pm');
my $content = Module::Install::_read($File::Find::name);
my $in_pod = 0;
foreach ( split /\n/, $content ) {
$in_pod = 1 if /^=\w/;
......@@ -351,7 +353,7 @@ sub find_extensions {
}
push @found, [ $file, $pkg ];
}, $path ) if -d $path;
}}, $path ) if -d $path;
@found;
}
......@@ -373,8 +375,6 @@ sub _caller {
return $call;
}
# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _read {
local *FH;
open( FH, '<', $_[0] ) or die "open($_[0]): $!";
......@@ -383,16 +383,6 @@ sub _read {
close FH or die "close($_[0]): $!";
return $string;
}
END_NEW
sub _read {
local *FH;
open( FH, "< $_[0]" ) or die "open($_[0]): $!";
binmode FH;
my $string = do { local $/; <FH> };
close FH or die "close($_[0]): $!";
return $string;
}
END_OLD
sub _readperl {
my $string = Module::Install::_read($_[0]);
......@@ -413,8 +403,6 @@ sub _readpod {
return $string;
}
# Done in evals to avoid confusing Perl::MinimumVersion
eval( $] >= 5.006 ? <<'END_NEW' : <<'END_OLD' ); die $@ if $@;
sub _write {
local *FH;
open( FH, '>', $_[0] ) or die "open($_[0]): $!";
......@@ -424,17 +412,6 @@ sub _write {
}
close FH or die "close($_[0]): $!";
}
END_NEW
sub _write {
local *FH;
open( FH, "> $_[0]" ) or die "open($_[0]): $!";
binmode FH;
foreach ( 1 .. $#_ ) {
print FH $_[$_] or die "print($_[0]): $!";
}
close FH or die "close($_[0]): $!";
}
END_OLD
# _version is for processing module versions (eg, 1.03_05) not
# Perl versions (eg, 5.8.1).
......
......@@ -6,7 +6,7 @@ use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
$VERSION = '0.08';
$VERSION = '0.10';
my %licenses = (
perl => 'Software::License::Perl_5',
......
......@@ -6,7 +6,7 @@ use warnings;
use base qw(Module::Install::Base);
use vars qw($VERSION);
$VERSION = '0.02';
$VERSION = '0.04';
sub auto_tester {
return if $Module::Install::AUTHOR;
......
......@@ -4,7 +4,7 @@ package Module::Install::Base;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
}
# Suspend handler for "redefined" warnings
......
......@@ -3,19 +3,20 @@ package Module::Install::Bugtracker;
use 5.006;
use strict;
use warnings;
use URI::Escape;
use base qw(Module::Install::Base);
our $VERSION = sprintf "%d.%02d%02d", q/0.3.0/ =~ /(\d+)/g;
our $VERSION = sprintf "%d.%02d%02d", q/0.3.6/ =~ /(\d+)/g;
sub auto_set_bugtracker {
my $self = shift;
if ($self->name) {
$self->configure_requires('URI::Escape', 0);
$self->include_deps('URI::Escape');
require URI::Escape;
$self->bugtracker(
sprintf 'http://rt.cpan.org/Public/Dist/Display.html?Name=%s',
uri_escape($self->name),
URI::Escape::uri_escape($self->name),
);
} else {
warn "can't set bugtracker if 'name' is not set\n";
......@@ -24,5 +25,5 @@ sub auto_set_bugtracker {
1;
__END__
#line 100
#line 101
......@@ -8,7 +8,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......@@ -121,6 +121,15 @@ END_C
# Can we locate a (the) C compiler
sub can_cc {
my $self = shift;
if ($^O eq 'VMS') {
require ExtUtils::CBuilder;
my $builder = ExtUtils::CBuilder->new(
quiet => 1,
);
return $builder->have_compiler;
}
my @chunks = split(/ /, $Config::Config{cc}) or return;
# $Config{cc} may contain args; try to find out the program part
......@@ -151,4 +160,4 @@ if ( $^O eq 'cygwin' ) {
__END__
#line 236
#line 245
......@@ -13,7 +13,7 @@ use vars qw( @ISA $VERSION );
use Module::Install::Base;
@ISA = qw( Module::Install::Base Module::AutoInstall );
$VERSION = sprintf "%d.%02d%02d", q/0.11.00/ =~ /(\d+)/g;
$VERSION = sprintf "%d.%02d%02d", q/0.11.5/ =~ /(\d+)/g;
# ---------------------------------------------------------------------------
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -20,7 +20,7 @@ use Module::Install::Base;
&get_bzip2_version
);
$VERSION = sprintf "%d.%02d%02d", q/0.30.8/ =~ /(\d+)/g;
$VERSION = sprintf "%d.%02d%02d", q/0.30.12/ =~ /(\d+)/g;
# ---------------------------------------------------------------------------
......@@ -380,7 +380,7 @@ sub get_gnu_version
$version_message = `$command`;
}
return undef unless
return undef unless ## no critic (ProhibitExplicitReturnUndef)
$version_message =~ /\b(GNU|Free\s+Software\s+Foundation)\b/s;
my ($program_version) = $version_message =~ /^.*?([\d]+\.[\d.a-z]+)/s;
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -8,7 +8,7 @@ use Fcntl qw/:flock :seek/;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base ();
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '1.14';
$VERSION = '1.19';
@ISA = 'Module::Install::Base';
$ISCORE = 1;
}
......
......@@ -3,7 +3,6 @@ package Module::Install::PRIVATE::Configure_Programs;
use strict;
use warnings;
use File::Slurp;
use lib 'inc';
use Module::Install::GetProgramLocations;
......@@ -21,7 +20,10 @@ sub configure_programs {
my ($self, @args) = @_;
$self->include('Module::Install::GetProgramLocations', 0);
$self->configure_requires('File::Slurp', 0);
$self->include_deps('File::Slurper', 0);
require File::Slurper;
File::Slurper->import('read_binary', 'write_binary');
my %info = (
'cat' => { default => 'cat', argname => 'CAT' },
......@@ -79,7 +81,7 @@ sub Update_Config
my $filename = shift;
my %locations = %{ shift @_ };
my $code = read_file($filename);
my $code = read_binary($filename);
foreach my $program (keys %locations)
{
......@@ -110,5 +112,5 @@ sub Update_Config
die "Couldn't find programs hash in $filename";
}
write_file($filename, $code);
write_binary($filename, $code);
}
......@@ -5,7 +5,6 @@ use strict;
use warnings;
use lib 'inc';
use Module::Install::AutomatedTester();
use vars qw( @ISA $VERSION );
......@@ -25,6 +24,11 @@ sub enable_verbose_cpan_testing {
$self->perl_version('5.005');
$self->include_deps('Module::Install::AutomatedTester', 0);
# Avoid subroutine redefined errors
if (!defined(&Module::Install::AutomatedTester::auto_tester)) {
require Module::Install::AutomatedTester;
}
return unless Module::Install::AutomatedTester::auto_tester();
unless(defined $ORIG_TEST_VIA_HARNESS) {
......
......@@ -3,7 +3,6 @@ package Module::Install::PRIVATE::Fix_Sort_Versions;
use strict;
use warnings;
use File::Slurp;
use vars qw( @ISA $VERSION );
......@@ -17,13 +16,18 @@ $VERSION = sprintf "%d.%02d%02d", q/0.1.0/ =~ /(\d+)/g;
sub fix_sort_versions {
my ($self, $file) = @_;
$self->configure_requires('File::Slurp', 0);
$self->perl_version('5.005');
$self->include_deps('File::Slurper', 0);
require File::Slurper;
File::Slurper->import('read_text', 'write_text');
print "Fixing POD in $file\n";
my $code = read_file($file);
my $code = read_text($file, undef, 1);
$code =~ s|^=encoding.*||m;
write_file($file, $code);
write_text($file, $code, undef, 1);
}
1;
#line 1
package Module::Install::StandardTests;
use warnings;
use strict;
use File::Spec;
use base 'Module::Install::Base';
our $VERSION = '0.05';
sub use_standard_tests {
my ($self, %specs) = @_;
my %with = map { $_ => 1 } qw/compile pod pod_coverage perl_critic/;
if (exists $specs{without}) {
$specs{without} = [ $specs{without} ] unless ref $specs{without};
delete $with{$_} for @{ $specs{without} };
}
$self->build_requires('Test::More');
$self->build_requires('UNIVERSAL::require');
# Unlike other tests, this is mandatory.
$self->build_requires('Test::Compile');
$self->write_standard_test_compile; # no if; this is mandatory
$self->write_standard_test_pod if $with{pod};
$self->write_standard_test_pod_coverage if $with{pod_coverage};
$self->write_standard_test_perl_critic if $with{perl_critic};
}
sub write_test_file {
my ($self, $filename, $code) = @_;
$filename = File::Spec->catfile('t', $filename);
# Outdent the code somewhat. Remove first empty line, if any. Then
# determine the indent of the first line. Throw that amount of indenting
# away from any line. This allows you to indent the code so it's visually
# clearer (see methods below) while creating output that's indented more
# or less correctly. Smoke result HTML pages link to the .t files, so it
# looks neater.
$code =~ s/^ *\n//;
(my $indent = $code) =~ s/^( *).*/$1/s;
$code =~ s/^$indent//gm;
print "Creating $filename\n";
open(my $fh, ">$filename") or die "can't create $filename $!";
my $perl = $^X;
print $fh <<TEST;
#!$perl -w
use strict;
use warnings;
$code
TEST
close $fh or die "can't close $filename $!\n";
$se