Subject: | Reduce ExtUtils::Install verbosity |
I've been looking at the diffs between the latest ActivePerl release and the
standard Perl distribution and found a number of changes that should be
integrated back, in my opinion. Most of them reduce the amount of
"informational" messages printed out during normal usage. These messages
often crowd out actual errors, so new users don't recognize when something
actually requires their attention.
The attached first patch suppresses some logging from ExtUtils::Install.
The MakeMaker tests rely on these messages, so we call them with
`make install VERBINST=1`.
The patch also modifies the architecture string written by `make ppd` to
include the Perl version number for Perl 5.8 and later to differentiate
between binary incompatible versions.
All diffs are against Perl 5.8.3, but apply against perl-current with offsets.
Cheers,
-Jan
--- lib/ExtUtils/Install.pm~ Mon Mar 22 16:02:25 2004
+++ lib/ExtUtils/Install.pm Mon Mar 22 16:04:01 2004
@@ -205,7 +205,7 @@
if ($pack{'write'}) {
$dir = install_rooted_dir(dirname($pack{'write'}));
mkpath($dir,0,0755) unless $nonono;
- print "Writing $pack{'write'}\n";
+ print "Writing $pack{'write'}\n" if $verbose;
$packlist->write(install_rooted_file($pack{'write'})) unless $nonono;
}
}
@@ -370,7 +370,7 @@
}
# if not verbose, we just say nothing
} else {
- print "Unlinking $targetfile (shadowing?)\n";
+ print "Unlinking $targetfile (shadowing?)\n" if $verbose;
forceunlink($targetfile);
}
}
--- lib/ExtUtils/MM_Unix.pm~ Mon Mar 22 16:02:25 2004
+++ lib/ExtUtils/MM_Unix.pm Mon Mar 22 16:04:01 2004
@@ -3357,7 +3357,14 @@
}
- $ppd_xml .= sprintf <<'PPD_OUT', $Config{archname};
+
+ my $archname = $Config{archname};
+ if ($^V ge v5.8) {
+# archname did not change from 5.6 to 5.8, but those versions may not be not
+binary compatible
+# so now we append the part of the version that changes when binary
+compatibility may change
+ $archname .= "-". substr($Config{version},0,3);
+ }
+ $ppd_xml .= sprintf <<'PPD_OUT', $archname;
<OS NAME="$(OSNAME)" />
<ARCHITECTURE NAME="%s" />
PPD_OUT
--- lib/ExtUtils/t/basic.t~ Mon Mar 22 16:02:26 2004
+++ lib/ExtUtils/t/basic.t Mon Mar 22 16:04:02 2004
@@ -96,7 +96,13 @@
' <DEPENDENCY>' );
like( $ppd_html, qr{^\s*<OS NAME="$Config{osname}" />}m,
' <OS>' );
-like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$Config{archname}" />}m,
+my $archname = $Config{archname};
+if ($^V ge v5.8) {
+# archname did not change from 5.6 to 5.8, but those versions may not be not
+binary compatible
+# so now we append the part of the version that changes when binary
+compatibility may change
+ $archname .= "-". substr($Config{version},0,3);
+}
+like( $ppd_html, qr{^\s*<ARCHITECTURE NAME="$archname" />}m,
' <ARCHITECTURE>');
like( $ppd_html, qr{^\s*<CODEBASE HREF="" />}m, ' <CODEBASE>');
like( $ppd_html, qr{^\s*</IMPLEMENTATION>}m, ' </IMPLEMENTATION>');
@@ -118,7 +124,7 @@
diag $test_out;
-my $install_out = run("$make install");
+my $install_out = run("$make install VERBINST=1");
is( $?, 0, 'install' ) || diag $install_out;
like( $install_out, qr/^Installing /m );
like( $install_out, qr/^Writing /m );
@@ -138,7 +144,7 @@
SKIP: {
skip "VMS install targets do not preserve $(PREFIX)", 8 if $Is_VMS;
- $install_out = run("$make install PREFIX=elsewhere");
+ $install_out = run("$make install VERBINST=1 PREFIX=elsewhere");
is( $?, 0, 'install with PREFIX override' ) || diag $install_out;
like( $install_out, qr/^Installing /m );
like( $install_out, qr/^Writing /m );
@@ -157,7 +163,7 @@
SKIP: {
skip "VMS install targets do not preserve $(DESTDIR)", 10 if $Is_VMS;
- $install_out = run("$make install PREFIX= DESTDIR=other");
+ $install_out = run("$make install VERBINST=1 PREFIX= DESTDIR=other");
is( $?, 0, 'install with DESTDIR' ) ||
diag $install_out;
like( $install_out, qr/^Installing /m );
@@ -197,7 +203,7 @@
SKIP: {
skip "VMS install targets do not preserve $(PREFIX)", 9 if $Is_VMS;
- $install_out = run("$make install PREFIX=elsewhere DESTDIR=other/");
+ $install_out = run("$make install VERBINST=1 PREFIX=elsewhere
+DESTDIR=other/");
is( $?, 0, 'install with PREFIX override and DESTDIR' ) ||
diag $install_out;
like( $install_out, qr/^Installing /m );