diff options
author | David Golden <dagolden@cpan.org> | 2010-07-19 14:33:29 -0700 |
---|---|---|
committer | David Golden <dagolden@cpan.org> | 2010-07-19 14:33:29 -0700 |
commit | 5f92f74fae1c66867c70b091f18078258a092fb6 (patch) | |
tree | 1ddd62edee102c83545c3166ce96be73da8c4f24 | |
parent | 7134fed3278cb3b7c6af8c4bd3b896978b554b07 (diff) | |
download | perl-5f92f74fae1c66867c70b091f18078258a092fb6.tar.gz |
core-cpan-diff: always use diff and ignore whitspace
-rwxr-xr-x | Porting/core-cpan-diff | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/Porting/core-cpan-diff b/Porting/core-cpan-diff index 2fd2153a07..75946185bb 100755 --- a/Porting/core-cpan-diff +++ b/Porting/core-cpan-diff @@ -128,7 +128,7 @@ sub run { if ( $reverse || $use_diff || $diff_opts || $verbose ); } else { - $diff_opts = '-u' unless defined $diff_opts; + $diff_opts = '-u -b' unless defined $diff_opts; usage("can't use -f without --crosscheck") if $force; } @@ -321,7 +321,8 @@ EOF $relative_mapped_file =~ s/^(cpan|dist|ext)\/.*?\///; my $different = - File::Compare::compare( $abs_cpan_file, $mapped_file ); + file_diff( $outfh, $abs_cpan_file, $mapped_file, $reverse, + $diff_opts ); if ( $different && customized( $m, $relative_mapped_file ) ) { if ($verbose) { print $outfh " Customized: $relative_mapped_file\n"; @@ -329,8 +330,8 @@ EOF } elsif ($different) { if ($use_diff) { - file_diff( $outfh, $abs_cpan_file, $mapped_file, $reverse, - $diff_opts ); + $different =~ s{^(--- |\+\+\+ )/tmp/[^/]+/}{$1}gm; + print $outfh $different; } else { if ( $cpan_file eq $relative_mapped_file ) { @@ -652,11 +653,8 @@ sub file_diff { else { push @cmd, $cpan_file, $perl_file; } - my $result = `@cmd`; + return `@cmd`; - $result =~ s{^(--- |\+\+\+ )/tmp/[^/]+/}{$1}gm; - - print $outfh $result; } sub customized { |