[Module-build-checkins] Module-Build/lib/Module/Build Base.pm,1.370,1.371
Status: Beta
Brought to you by:
kwilliams
From: Ken W. <kwi...@us...> - 2005-01-06 02:59:51
|
Update of /cvsroot/module-build/Module-Build/lib/Module/Build In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13313/lib/Module/Build Modified Files: Base.pm Log Message: There are namespace clashes with warn() and verbose(), so change method names to log_info(), log_verbose(), and log_warn() Index: Base.pm =================================================================== RCS file: /cvsroot/module-build/Module-Build/lib/Module/Build/Base.pm,v retrieving revision 1.370 retrieving revision 1.371 diff -C2 -d -r1.370 -r1.371 *** Base.pm 6 Jan 2005 02:34:21 -0000 1.370 --- Base.pm 6 Jan 2005 02:59:42 -0000 1.371 *************** *** 42,47 **** unless ($self->_perl_is_same($self->{properties}{perl})) { my $perl = $self->find_perl_interpreter; ! $self->warn(" * WARNING: Configuration was initially created with '$self->{properties}{perl}',\n". ! " but we are now using '$perl'.\n"); } --- 42,47 ---- unless ($self->_perl_is_same($self->{properties}{perl})) { my $perl = $self->find_perl_interpreter; ! $self->log_warn(" * WARNING: Configuration was initially created with '$self->{properties}{perl}',\n". ! " but we are now using '$perl'.\n"); } *************** *** 100,104 **** # (e.g. to run tests). $p->{perl} = $self->find_perl_interpreter ! or $self->warn("Warning: Can't locate your perl binary"); $p->{bindoc_dirs} ||= [ "$p->{blib}/script" ]; --- 100,104 ---- # (e.g. to run tests). $p->{perl} = $self->find_perl_interpreter ! or $self->log_warn("Warning: Can't locate your perl binary"); $p->{bindoc_dirs} ||= [ "$p->{blib}/script" ]; *************** *** 119,124 **** ################## End constructors ######################### ! sub info { shift; print @_; } ! sub warn { shift; Carp::carp @_; } sub _set_install_paths { --- 119,125 ---- ################## End constructors ######################### ! sub log_info { shift; print @_; } ! sub log_warn { shift; Carp::carp @_; } ! sub log_verbose { shift()->log_info(@_) if $_[0]->verbose } sub _set_install_paths { *************** *** 292,296 **** return if $self->up_to_date([$self->config_file('config_data'), $self->config_file('features')], $notes_pm); ! $self->info("Writing config notes to $notes_pm\n"); File::Path::mkpath(File::Basename::dirname($notes_pm)); my $fh = IO::File->new("> $notes_pm") or die "Can't create '$notes_pm': $!"; --- 293,297 ---- return if $self->up_to_date([$self->config_file('config_data'), $self->config_file('features')], $notes_pm); ! $self->log_info("Writing config notes to $notes_pm\n"); File::Path::mkpath(File::Basename::dirname($notes_pm)); my $fh = IO::File->new("> $notes_pm") or die "Can't create '$notes_pm': $!"; *************** *** 622,626 **** my $filename = File::Spec->catfile($build_dir, 'lib', split '::', $opts{class}) . '.pm'; my $filedir = File::Basename::dirname($filename); ! $pack->info("Creating custom builder $filename in $filedir\n"); File::Path::mkpath($filedir); --- 623,627 ---- my $filename = File::Spec->catfile($build_dir, 'lib', split '::', $opts{class}) . '.pm'; my $filedir = File::Basename::dirname($filename); ! $pack->log_info("Creating custom builder $filename in $filedir\n"); File::Path::mkpath($filedir); *************** *** 747,751 **** my $result = eval $eval; *UNIVERSAL::VERSION = $old_version; ! $self->warn("Error evaling version line '$eval' in $file: $@\n") if $@; # Unbless it if it's a version.pm object --- 748,752 ---- my $result = eval $eval; *UNIVERSAL::VERSION = $old_version; ! $self->log_warn("Error evaling version line '$eval' in $file: $@\n") if $@; # Unbless it if it's a version.pm object *************** *** 881,895 **** my $failures = $self->prereq_failures($info); if ($failures) { ! $self->warn("Feature '$name' disabled because of the following prerequisite failures:\n"); foreach my $type (qw(requires build_requires conflicts recommends)) { next unless $failures->{$type}; while (my ($module, $status) = each %{$failures->{$type}}) { ! $self->warn(" * $status->{message}\n"); } ! $self->warn("\n"); } $self->feature($name => 0); } else { ! $self->warn("Feature '$name' enabled.\n\n"); $self->feature($name => 1); } --- 882,896 ---- my $failures = $self->prereq_failures($info); if ($failures) { ! $self->log_warn("Feature '$name' disabled because of the following prerequisite failures:\n"); foreach my $type (qw(requires build_requires conflicts recommends)) { next unless $failures->{$type}; while (my ($module, $status) = each %{$failures->{$type}}) { ! $self->log_warn(" * $status->{message}\n"); } ! $self->log_warn("\n"); } $self->feature($name => 0); } else { ! $self->info("Feature '$name' enabled.\n\n"); $self->feature($name => 1); } *************** *** 941,950 **** my $prefix = $type eq 'recommends' ? '' : 'ERROR: '; while (my ($module, $status) = each %{$failures->{$type}}) { ! $self->warn(" * $prefix$status->{message}\n"); } } ! $self->warn("ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions\n". ! " of the modules indicated above before proceeding with this installation.\n\n"); return 0; } --- 942,951 ---- my $prefix = $type eq 'recommends' ? '' : 'ERROR: '; while (my ($module, $status) = each %{$failures->{$type}}) { ! $self->log_warn(" * $prefix$status->{message}\n"); } } ! $self->log_warn("ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions\n". ! " of the modules indicated above before proceeding with this installation.\n\n"); return 0; } *************** *** 1030,1034 **** my $eval_str = "\$v1 $op \$v2"; my $result = eval $eval_str; ! $self->warn("error comparing versions: '$eval_str' $@") if $@; return $result; --- 1031,1035 ---- my $eval_str = "\$v1 $op \$v2"; my $result = eval $eval_str; ! $self->log_warn("error comparing versions: '$eval_str' $@") if $@; return $result; *************** *** 1152,1160 **** if ( $self->delete_filetree($build_script) ) { ! $self->info("Removed previous script '$build_script'\n"); } ! $self->info("Creating new '$build_script' script for ", ! "'$dist_name' version '$dist_version'\n"); my $fh = IO::File->new(">$build_script") or die "Can't create '$build_script': $!"; $self->print_build_script($fh); --- 1153,1161 ---- if ( $self->delete_filetree($build_script) ) { ! $self->log_info("Removed previous script '$build_script'\n"); } ! $self->log_info("Creating new '$build_script' script for ", ! "'$dist_name' version '$dist_version'\n"); my $fh = IO::File->new(">$build_script") or die "Can't create '$build_script': $!"; $self->print_build_script($fh); *************** *** 1177,1185 **** if (my @missed = ExtUtils::Manifest::manicheck()) { ! $self->warn("Warning: the following files are missing in your kit:\n", ! "\t", join("\n\t", @missed), "\n", ! "Please inform the author.\n"); } else { ! $self->info("Checking whether your kit is complete...\nLooks good\n"); } } --- 1178,1186 ---- if (my @missed = ExtUtils::Manifest::manicheck()) { ! $self->log_warn("Warning: the following files are missing in your kit:\n", ! "\t", join("\n\t", @missed), "\n", ! "Please inform the author.\n"); } else { ! $self->log_info("Checking whether your kit is complete...\nLooks good\n"); } } *************** *** 1478,1482 **** Test::Harness::runtests(@$tests); } else { ! $self->info("No tests defined.\n"); } --- 1479,1483 ---- Test::Harness::runtests(@$tests); } else { ! $self->log_info("No tests defined.\n"); } *************** *** 1513,1517 **** unless ($self->find_module_by_name('Devel::Cover', \@INC)) { ! $self->warn("Cannot run testcover action unless Devel::Cover is installed.\n"); return; } --- 1514,1518 ---- unless ($self->find_module_by_name('Devel::Cover', \@INC)) { ! $self->log_warn("Cannot run testcover action unless Devel::Cover is installed.\n"); return; } *************** *** 1722,1726 **** my $interpreter = $self->{properties}{perl}; ! $self->info("Changing sharpbang in $file to $interpreter") if $self->{verbose}; my $shb = ''; $shb .= "$c->{sharpbang}$interpreter $arg\n" if $does_shbang; --- 1723,1727 ---- my $interpreter = $self->{properties}{perl}; ! $self->log_verbose("Changing sharpbang in $file to $interpreter"); my $shb = ''; $shb .= "$c->{sharpbang}$interpreter $arg\n" if $does_shbang; *************** *** 1750,1754 **** unlink "$file.bak" ! or $self->warn("Couldn't clean up $file.bak, leaving it there"); $self->do_system($c->{eunicefix}, $file) if $c->{eunicefix} ne ':'; --- 1751,1755 ---- unlink "$file.bak" ! or $self->log_warn("Couldn't clean up $file.bak, leaving it there"); $self->do_system($c->{eunicefix}, $file) if $c->{eunicefix} ne ':'; *************** *** 1808,1812 **** my $outfile = File::Spec->catfile( $mandir, $manpage); next if $self->up_to_date( $file, $outfile ); ! $self->info("Manifying $file -> $outfile\n"); $parser->parse_from_file( $file, $outfile ); $files->{$file} = $outfile; --- 1809,1813 ---- my $outfile = File::Spec->catfile( $mandir, $manpage); next if $self->up_to_date( $file, $outfile ); ! $self->log_info("Manifying $file -> $outfile\n"); $parser->parse_from_file( $file, $outfile ); $files->{$file} = $outfile; *************** *** 1828,1832 **** my $outfile = File::Spec->catfile( $mandir, $manpage); next if $self->up_to_date( $file, $outfile ); ! $self->info("Manifying $file -> $outfile\n"); $parser->parse_from_file( $file, $outfile ); $files->{$file} = $outfile; --- 1829,1833 ---- my $outfile = File::Spec->catfile( $mandir, $manpage); next if $self->up_to_date( $file, $outfile ); ! $self->log_info("Manifying $file -> $outfile\n"); $parser->parse_from_file( $file, $outfile ); $files->{$file} = $outfile; *************** *** 1950,1955 **** push @opts, "--css=$path2root/$args{css}" if $args{css}; ! $self->info("Creating $outfile\n"); ! $self->info("pod2html @opts\n") if $self->verbose; Pod::Html::pod2html(@opts); # or warn "pod2html @opts failed: $!"; } --- 1951,1956 ---- push @opts, "--css=$path2root/$args{css}" if $args{css}; ! $self->log_info("Creating $outfile\n"); ! $self->log_verbose("pod2html @opts\n"); Pod::Html::pod2html(@opts); # or warn "pod2html @opts failed: $!"; } *************** *** 2122,2126 **** chmod($mode, $manifest); ! $self->info(map "Added to $manifest: $_\n", @$lines); } --- 2123,2127 ---- chmod($mode, $manifest); ! $self->log_info(map "Added to $manifest: $_\n", @$lines); } *************** *** 2129,2133 **** unless (eval { require Module::Signature; 1 }) { ! $self->warn("Couldn't load Module::Signature for 'distsign' action:\n $@\n"); return; } --- 2130,2134 ---- unless (eval { require Module::Signature; 1 }) { ! $self->log_warn("Couldn't load Module::Signature for 'distsign' action:\n $@\n"); return; } *************** *** 2203,2207 **** unless ($dist_files and keys %$dist_files); ! $self->warn("*** Did you forget to add $self->{metafile} to the MANIFEST?\n") unless exists $dist_files->{$self->{metafile}}; --- 2204,2208 ---- unless ($dist_files and keys %$dist_files); ! $self->log_warn("*** Did you forget to add $self->{metafile} to the MANIFEST?\n") unless exists $dist_files->{$self->{metafile}}; *************** *** 2213,2217 **** my $new = $self->copy_if_modified(from => $file, to_dir => $dist_dir, verbose => 0); chmod +(stat $file)[2], $new ! or $self->warn("Couldn't set permissions on $new: $!"); } --- 2214,2218 ---- my $new = $self->copy_if_modified(from => $file, to_dir => $dist_dir, verbose => 0); chmod +(stat $file)[2], $new ! or $self->log_warn("Couldn't set permissions on $new: $!"); } *************** *** 2279,2283 **** my $maniskip = 'MANIFEST.SKIP'; unless ( -e 'MANIFEST' || -e $maniskip ) { ! $self->warn("File '$maniskip' does not exist: Creating a default '$maniskip'\n"); $self->_write_default_maniskip($maniskip); } --- 2280,2284 ---- my $maniskip = 'MANIFEST.SKIP'; unless ( -e 'MANIFEST' || -e $maniskip ) { ! $self->log_warn("File '$maniskip' does not exist: Creating a default '$maniskip'\n"); $self->_write_default_maniskip($maniskip); } *************** *** 2369,2373 **** unless ($p->{license}) { ! $self->warn("No license specified, setting license = 'unknown'\n"); $p->{license} = 'unknown'; } --- 2370,2374 ---- unless ($p->{license}) { ! $self->log_warn("No license specified, setting license = 'unknown'\n"); $p->{license} = 'unknown'; } *************** *** 2388,2392 **** require Module::Build::ConfigData; # Only works after the 'build' unless (Module::Build::ConfigData->feature('YAML_support')) { ! $self->warn(<<EOM); \nCouldn't load YAML.pm, generating a minimal META.yml without it. Please check and edit the generated metadata, or consider installing YAML.pm.\n --- 2389,2393 ---- require Module::Build::ConfigData; # Only works after the 'build' unless (Module::Build::ConfigData->feature('YAML_support')) { ! $self->log_warn(<<EOM); \nCouldn't load YAML.pm, generating a minimal META.yml without it. Please check and edit the generated metadata, or consider installing YAML.pm.\n *************** *** 2480,2487 **** $file ||= $dir; ! $self->info("Creating $file.tar.gz\n"); if ($self->{args}{tar}) { ! my $tar_flags = $self->{properties}{verbose} ? 'cvf' : 'cf'; $self->do_system($self->split_like_shell($self->{args}{tar}), $tar_flags, "$file.tar", $dir); $self->do_system($self->split_like_shell($self->{args}{gzip}), "$file.tar") if $self->{args}{gzip}; --- 2481,2488 ---- $file ||= $dir; ! $self->log_info("Creating $file.tar.gz\n"); if ($self->{args}{tar}) { ! my $tar_flags = $self->verbose ? 'cvf' : 'cf'; $self->do_system($self->split_like_shell($self->{args}{tar}), $tar_flags, "$file.tar", $dir); $self->do_system($self->split_like_shell($self->{args}{gzip}), "$file.tar") if $self->{args}{gzip}; *************** *** 2583,2587 **** foreach (@_) { next unless -e $_; ! $self->info("Deleting $_\n"); File::Path::rmtree($_, 0, 0); die "Couldn't remove '$_': $!\n" if -e $_; --- 2584,2588 ---- foreach (@_) { next unless -e $_; ! $self->log_info("Deleting $_\n"); File::Path::rmtree($_, 0, 0); die "Couldn't remove '$_': $!\n" if -e $_; *************** *** 2625,2631 **** return $p->{have_compiler} if defined $p->{have_compiler}; ! $self->info("Checking if compiler tools configured... ") if $p->{verbose}; my $have = $self->_cbuilder->have_compiler; ! $self->info($have ? "ok.\n" : "failed.\n") if $p->{verbose}; return $p->{have_compiler} = $have; } --- 2626,2632 ---- return $p->{have_compiler} if defined $p->{have_compiler}; ! $self->log_verbose("Checking if compiler tools configured... "); my $have = $self->_cbuilder->have_compiler; ! $self->log_verbose($have ? "ok.\n" : "failed.\n"); return $p->{have_compiler} = $have; } *************** *** 2672,2676 **** my ($self, $file, %args) = @_; ! $self->info("$file -> $args{outfile}\n"); if (eval {require ExtUtils::ParseXS; 1}) { --- 2673,2677 ---- my ($self, $file, %args) = @_; ! $self->log_info("$file -> $args{outfile}\n"); if (eval {require ExtUtils::ParseXS; 1}) { *************** *** 2694,2698 **** qq{-typemap "$typemap" "$file"}); ! $self->info($command); my $fh = IO::File->new("> $args{outfile}") or die "Couldn't write $args{outfile}: $!"; print $fh `$command`; --- 2695,2699 ---- qq{-typemap "$typemap" "$file"}); ! $self->log_info($command); my $fh = IO::File->new("> $args{outfile}") or die "Couldn't write $args{outfile}: $!"; print $fh `$command`; *************** *** 2780,2784 **** unless ($self->up_to_date($file, "$file_base.bs")) { require ExtUtils::Mkbootstrap; ! $self->info("ExtUtils::Mkbootstrap::Mkbootstrap('$file_base')\n"); ExtUtils::Mkbootstrap::Mkbootstrap($file_base); # Original had $BSLOADLIBS - what's that? {my $fh = IO::File->new(">> $file_base.bs")} # create --- 2781,2785 ---- unless ($self->up_to_date($file, "$file_base.bs")) { require ExtUtils::Mkbootstrap; ! $self->log_info("ExtUtils::Mkbootstrap::Mkbootstrap('$file_base')\n"); ExtUtils::Mkbootstrap::Mkbootstrap($file_base); # Original had $BSLOADLIBS - what's that? {my $fh = IO::File->new(">> $file_base.bs")} # create *************** *** 2793,2797 **** sub do_system { my ($self, @cmd) = @_; ! $self->info("@cmd\n"); return !system(@cmd); } --- 2794,2798 ---- sub do_system { my ($self, @cmd) = @_; ! $self->log_info("@cmd\n"); return !system(@cmd); } *************** *** 2825,2829 **** File::Path::mkpath(File::Basename::dirname($to_path), 0, 0777); ! $self->info("$file -> $to_path\n") if $args{verbose}; File::Copy::copy($file, $to_path) or die "Can't copy('$file', '$to_path'): $!"; return $to_path; --- 2826,2830 ---- File::Path::mkpath(File::Basename::dirname($to_path), 0, 0777); ! $self->log_info("$file -> $to_path\n") if $args{verbose}; File::Copy::copy($file, $to_path) or die "Can't copy('$file', '$to_path'): $!"; return $to_path; *************** *** 2840,2844 **** foreach my $file (@$source) { unless (-e $file) { ! $self->warn("Can't find source file $file for up-to-date check"); next; } --- 2841,2845 ---- foreach my $file (@$source) { unless (-e $file) { ! $self->log_warn("Can't find source file $file for up-to-date check"); next; } |