Skip to content

Commit

Permalink
mega trailing whitespace cleanup
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.perl.org/modules/Module-Build/trunk@13568 50811bd7-b8ce-0310-adc1-d9db26280581
  • Loading branch information
xdg committed Nov 19, 2009
1 parent 026806f commit 64124ac
Show file tree
Hide file tree
Showing 35 changed files with 219 additions and 218 deletions.
8 changes: 4 additions & 4 deletions lib/Module/Build.pm
Expand Up @@ -300,7 +300,7 @@ tarball of the files listed in F<MANIFEST> and compress the tarball using
GZIP compression.
By default, this action will use the C<Archive::Tar> module. However, you can
force it to use binary "tar" and "gzip" executables by supplying an explicit
force it to use binary "tar" and "gzip" executables by supplying an explicit
C<tar> (and optional C<gzip>) parameter:
./Build dist --tar C:\path\to\tar.exe --gzip C:\path\to\zip.exe
Expand Down Expand Up @@ -541,7 +541,7 @@ for a bug report.
[version 0.28]
This action is identical to the C<install> action. In the future,
though, when C<install> starts writing to the file
though, when C<install> starts writing to the file
F<$(INSTALLARCHLIB)/perllocal.pod>, C<pure_install> won't, and that
will be the only difference between them.
Expand Down Expand Up @@ -666,15 +666,15 @@ argument.
[version 0.25]
This checks all the files described in the C<docs> action and
This checks all the files described in the C<docs> action and
produces C<Test::Harness>-style output. If you are a module author,
this is useful to run before creating a new release.
=item testpodcoverage
[version 0.28]
This checks the pod coverage of the distribution and
This checks the pod coverage of the distribution and
produces C<Test::Harness>-style output. If you are a module author,
this is useful to run before creating a new release.
Expand Down
1 change: 1 addition & 0 deletions lib/Module/Build/Base.pm
Expand Up @@ -2416,6 +2416,7 @@ sub _action_listing {
while (my ($one, $two) = splice @actions, 0, 2) {
$out .= sprintf(" %-12s %-12s\n", $one, $two||'');
}
$out =~ s{\s*$}{}mg; # remove trailing spaces
return $out;
}

Expand Down
62 changes: 31 additions & 31 deletions lib/Module/Build/Compat.pm
Expand Up @@ -18,7 +18,7 @@ my %convert_installdirs = (
VENDOR => 'vendor',
);

my %makefile_to_build =
my %makefile_to_build =
(
TEST_VERBOSE => 'verbose',
VERBINST => 'verbose',
Expand Down Expand Up @@ -89,18 +89,18 @@ sub _merge_prereq {
}
return %$merge;
}


sub create_makefile_pl {
my ($package, $type, $build, %args) = @_;

die "Don't know how to build Makefile.PL of type '$type'"
unless $type =~ /^(small|passthrough|traditional)$/;

if ($type eq 'passthrough') {
$build->log_warn(<<"HERE");
IMPORTANT NOTE: The '$type' style of Makefile.PL is deprecated and
IMPORTANT NOTE: The '$type' style of Makefile.PL is deprecated and
may be removed in a future version of Module::Build in favor of the
'configure_requires' property. See Module::Build::Compat
documentation for details.
Expand All @@ -120,7 +120,7 @@ HERE

print {$fh} "# Note: this file was auto-generated by ", __PACKAGE__, " version $VERSION\n";

# Minimum perl version should be specified as "require 5.XXXXXX" in
# Minimum perl version should be specified as "require 5.XXXXXX" in
# Makefile.PL
my $requires = $build->requires;
if ( my $minimum_perl = $requires->{perl} ) {
Expand Down Expand Up @@ -160,69 +160,69 @@ EOF

} elsif ($type eq 'passthrough') {
printf {$fh} <<'EOF', $subclass_load, ref($build), ref($build);
unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";
require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');
unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}
require Cwd;
require File::Spec;
require CPAN;
# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();
CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";
chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;
%s
Module::Build::Compat->run_build_pl(args => \@ARGV);
my $build_script = 'Build';
my $build_script = 'Build';
$build_script .= '.com' if $^O eq 'VMS';
exit(0) unless(-e $build_script); # cpantesters convention
require %s;
Module::Build::Compat->write_makefile(build_class => '%s');
EOF

} elsif ($type eq 'traditional') {

my (%MM_Args, %prereq);
if (eval "use Tie::IxHash; 1") {
tie %MM_Args, 'Tie::IxHash'; # Don't care if it fails here
tie %prereq, 'Tie::IxHash'; # Don't care if it fails here
}

my %name = ($build->module_name
? (NAME => $build->module_name)
: (DISTNAME => $build->dist_name));

my %version = ($build->dist_version_from
? (VERSION_FROM => $build->dist_version_from)
: (VERSION => $build->dist_version)
);
%MM_Args = (%name, %version);

%prereq = _merge_prereq( $build->requires, $build->build_requires );
%prereq = map {$_, $prereq{$_}} sort keys %prereq;

delete $prereq{perl};
$MM_Args{PREREQ_PM} = \%prereq;

$MM_Args{INSTALLDIRS} = $build->installdirs eq 'core' ? 'perl' : $build->installdirs;

$MM_Args{EXE_FILES} = [ sort keys %{$build->script_files} ] if $build->script_files;

$MM_Args{PL_FILES} = $build->PL_files || {};

if ($build->recursive_test_files) {
Expand All @@ -232,7 +232,7 @@ EOF
local $Data::Dumper::Terse = 1;
my $args = Data::Dumper::Dumper(\%MM_Args);
$args =~ s/\{(.*)\}/($1)/s;

print $fh <<"EOF";
use ExtUtils::MakeMaker;
WriteMakefile
Expand All @@ -250,7 +250,7 @@ sub _test_globs {

sub subclass_dir {
my ($self, $build) = @_;

return (Module::Build::ModuleInfo->find_module_dir_by_name(ref $build)
|| File::Spec->catdir($build->config_dir, 'lib'));
}
Expand All @@ -265,7 +265,7 @@ sub makefile_to_build_args {
my @out;
foreach my $arg (@_) {
next if $arg eq '';

my ($key, $val) = ($arg =~ /^(\w+)=(.+)/ ? ($1, $2) :
die "Malformed argument '$arg'");

Expand Down Expand Up @@ -320,7 +320,7 @@ sub makefile_to_build_macros {
}
}
}
push @out, (config => \%config) if %config;
push @out, (config => \%config) if %config;
return @out;
}

Expand Down Expand Up @@ -379,19 +379,19 @@ $action : force_do_it
$perl $Build $action
EOF
}

if ($self->_is_vms_mms) {
# Roll our own .EXPORT as MMS/MMK don't honor that directive.
$maketext .= "\n.FIRST\n\t\@ $noop\n";
$maketext .= "\n.FIRST\n\t\@ $noop\n";
for my $macro (keys %macro_to_build) {
$maketext .= ".IFDEF $macro\n\tDEFINE $macro \"\$($macro)\"\n.ENDIF\n";
}
$maketext .= "\n";
$maketext .= "\n";
}
else {
$maketext .= "\n.EXPORT : " . join(' ', keys %macro_to_build) . "\n\n";
}

return $maketext;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Module/Build/Cookbook.pm
Expand Up @@ -487,7 +487,7 @@ Next, add this to the top of your F<Build.PL>.
# Find out what version of Module::Build is installed or fail quietly.
# This should be cross-platform.
my $Installed_MB =
my $Installed_MB =
`$^X -e "eval q{require Module::Build; print Module::Build->VERSION} or exit 1";
# some operating systems put a newline at the end of every print.
Expand Down
8 changes: 4 additions & 4 deletions lib/Module/Build/ModuleInfo.pm
Expand Up @@ -23,7 +23,7 @@ my $PKG_REGEXP = qr{ # match a package declaration
\s+ # whitespace
([\w:]+) # a package name
\s* # optional whitespace
($V_NUM_REGEXP)? # optional version number
($V_NUM_REGEXP)? # optional version number
\s* # optional whitesapce
; # semicolon line terminator
}x;
Expand Down Expand Up @@ -235,7 +235,7 @@ sub _parse_fh {
$need_vers = 0 if $vers_pkg eq $pkg;

unless ( defined $vers{$vers_pkg} && length $vers{$vers_pkg} ) {
$vers{$vers_pkg} =
$vers{$vers_pkg} =
$self->_evaluate_version_line( $vers_sig, $vers_fullname, $line );
} else {
# Warn unless the user is using the "$VERSION = eval
Expand Down Expand Up @@ -326,7 +326,7 @@ sub _evaluate_version_line {
(ref($vsub) eq 'CODE') or
die "failed to build version sub for $self->{filename}";
my $result = eval { $vsub->() };
die "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n"
die "Could not get version from $self->{filename} by executing:\n$eval\n\nThe fatal error was: $@\n"
if $@;

# Activestate apparently creates custom versions like '1.23_45_01', which
Expand All @@ -340,7 +340,7 @@ sub _evaluate_version_line {

# Bless it into our own version class
eval { $result = Module::Build::Version->new($result) };
die "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n"
die "Version '$result' from $self->{filename} does not appear to be valid:\n$eval\n\nThe fatal error was: $@\n"
if $@;

return $result;
Expand Down
32 changes: 16 additions & 16 deletions lib/Module/Build/Notes.pm
Expand Up @@ -33,10 +33,10 @@ sub restore {
sub access {
my $self = shift;
return $self->read() unless @_;

my $key = shift;
return $self->read($key) unless @_;

my $value = shift;
$self->write({ $key => $value });
return $self->read($key);
Expand All @@ -61,7 +61,7 @@ sub read {
return $self->{new}{$key} if exists $self->{new}{$key};
return $self->{disk}{$key};
}

# Return all data
my $out = (keys %{$self->{new}}
? {%{$self->{disk}}, %{$self->{new}}}
Expand All @@ -79,7 +79,7 @@ sub _same {
sub write {
my ($self, $href) = @_;
$href ||= {};

@{$self->{new}}{ keys %$href } = values %$href; # Merge

# Do some optimization to avoid unnecessary writes
Expand All @@ -88,25 +88,25 @@ sub write {
next if ref $self->{disk}{$key} or !exists $self->{disk}{$key};
delete $self->{new}{$key} if $self->_same($self->{new}{$key}, $self->{disk}{$key});
}

if (my $file = $self->{file}) {
my ($vol, $dir, $base) = File::Spec->splitpath($file);
$dir = File::Spec->catpath($vol, $dir, '');
return unless -e $dir && -d $dir; # The user needs to arrange for this

return if -e $file and !keys %{ $self->{new} }; # Nothing to do
@{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge

@{$self->{disk}}{ keys %{$self->{new}} } = values %{$self->{new}}; # Merge
$self->_dump($file, $self->{disk});

$self->{new} = {};
}
return $self->read;
}

sub _dump {
my ($self, $file, $data) = @_;

my $fh = IO::File->new("> $file") or die "Can't create '$file': $!";
print {$fh} Module::Build::Dumper->_data_dump($data);
}
Expand All @@ -126,7 +126,7 @@ sub write_config_data {
# strip out private POD markers we use to keep pod from being
# recognized for *this* source file
$template =~ s{$_\n}{} for '=begin private', '=end private';

my $fh = IO::File->new("> $args{file}") or die "Can't create '$args{file}': $!";
print {$fh} $template;
print {$fh} "\n__DATA__\n";
Expand Down Expand Up @@ -218,18 +218,18 @@ sub write {
sub feature {
my ($package, $key) = @_;
return $features->{$key} if exists $features->{$key};
my $info = $auto_features->{$key} or return 0;
# Under perl 5.005, each(%$foo) isn't working correctly when $foo
# was reanimated with Data::Dumper and eval(). Not sure why, but
# copying to a new hash seems to solve it.
my %info = %$info;
require Module::Build; # XXX should get rid of this
while (my ($type, $prereqs) = each %info) {
next if $type eq 'description' || $type eq 'recommends';
my %p = %$prereqs; # Ditto here.
while (my ($modname, $spec) = each %p) {
my $status = Module::Build->check_installed_status($modname, $spec);
Expand All @@ -251,10 +251,10 @@ NOTES_NAME - Configuration for MODULE_NAME
use NOTES_NAME;
$value = NOTES_NAME->config('foo');
$value = NOTES_NAME->feature('bar');
@names = NOTES_NAME->config_names;
@names = NOTES_NAME->feature_names;
NOTES_NAME->set_config(foo => $new_value);
NOTES_NAME->set_feature(bar => $new_value);
NOTES_NAME->write; # Save changes
Expand Down
2 changes: 1 addition & 1 deletion lib/Module/Build/PPMMaker.pm
Expand Up @@ -137,7 +137,7 @@ sub _varchname { # Copied from PPM.pm
'<' => '&lt;',
);
my $rx = join '|', keys %escapes;

sub _simple_xml_escape {
$_[1] =~ s/($rx)/$escapes{$1}/go;
}
Expand Down

0 comments on commit 64124ac

Please sign in to comment.