- next;
- }
- delete $perl_unseen{$packed_file};
- }
- else {
- if ($ignorable{$cpan_file}) {
- print $outfh " Ignored: $cpan_file\n" if $verbose;
- next;
- }
-
- unless ($use_diff) {
- print $outfh " CPAN only: $cpan_file",
- ($cpan_file eq $mapped_file) ? "\n"
- : " (expected $mapped_file)\n";
- }
- next;
- }
- }
-
-
- my $abs_cpan_file = File::Spec->catfile($cpan_dir, $cpan_file);
-
- # should never happen
- die "ERROR: can't find file $abs_cpan_file\n" unless -f $abs_cpan_file;
-
- # might happen if the FILES entry in Maintainers.pl is wrong
- unless (-f $mapped_file) {
- print $outfh "WARNING: perl file not found: $mapped_file\n";
- next;
- }
-
-
- if (File::Compare::compare($abs_cpan_file, $mapped_file)) {
- if ($use_diff) {
- file_diff($outfh, $abs_cpan_file, $mapped_file,
- $reverse, $diff_opts);
- }
- else {
- if ($cpan_file eq $mapped_file) {
- print $outfh " Modified: $cpan_file\n";
- }
- else {
- print $outfh " Modified: $cpan_file $mapped_file\n";
- }
- }
- }
- elsif ($verbose) {
- if ($cpan_file eq $mapped_file) {
- print $outfh " Unchanged: $cpan_file\n";
- }
- else {
- print $outfh " Unchanged: $cpan_file $mapped_file\n";
- }
- }
- }
- for (sort keys %perl_unseen) {
- print $outfh " Perl only: $_\n" unless $use_diff;
- }
+ next;
+ }
+ delete $perl_unseen{$packed_file};
+ }
+ else {
+ if ( $ignorable{$cpan_file} ) {
+ print $outfh " Ignored: $cpan_file\n" if $verbose;
+ next;
+ }
+
+ unless ($use_diff) {
+ print $outfh " CPAN only: $cpan_file",
+ ( $cpan_file eq $mapped_file )
+ ? "\n"
+ : " (missing $mapped_file)\n";
+ }
+ next;
+ }
+ }
+
+ my $abs_cpan_file = catfile( $cpan_dir, $cpan_file );
+
+ # should never happen
+ die "ERROR: can't find file $abs_cpan_file\n"
+ unless -f $abs_cpan_file;
+
+ # might happen if the FILES entry in Maintainers.pl is wrong
+ unless ( -f $mapped_file ) {
+ print $outfh "WARNING: perl file not found: $mapped_file\n";
+ next;
+ }
+
+ my $relative_mapped_file = relatively_mapped($mapped_file);
+
+ my $different =
+ file_diff( $outfh, $abs_cpan_file, $mapped_file, $reverse,
+ $diff_opts );
+ if ( $different && customized( $m, $relative_mapped_file ) ) {
+ print $outfh " Customized for blead: $relative_mapped_file\n";
+ if ( $use_diff && $verbose ) {
+ $different =~ s{^(--- |\+\+\+ )/tmp/[^/]+/}{$1}gm;
+ print $outfh $different;
+ }
+ }
+ elsif ($different) {
+ if ($use_diff) {
+ $different =~ s{^(--- |\+\+\+ )/tmp/[^/]+/}{$1}gm;
+ print $outfh $different;
+ }
+ else {
+ if ( $cpan_file eq $relative_mapped_file ) {
+ print $outfh " Modified: $relative_mapped_file\n";
+ }
+ else {
+ print $outfh
+ " Modified: $cpan_file $relative_mapped_file\n";
+ }
+
+ if ( $cpan_file =~ m{\.pm\z} ) {
+ my $pv = MM->parse_version($mapped_file) || 'unknown';
+ my $cv = MM->parse_version($abs_cpan_file) || 'unknown';
+ if ( $pv ne $cv ) {
+ print $outfh
+" Version mismatch in '$cpan_file':\n $cv (cpan) vs $pv (perl)\n";
+ }
+ }
+
+ }
+ }
+ elsif ( customized( $m, $relative_mapped_file ) ) {
+ # Maintainers.pl says we customized it, but it looks the
+ # same as CPAN so maybe we lost the customization, which
+ # could be bad
+ if ( $cpan_file eq $relative_mapped_file ) {
+ print $outfh " Blead customization missing: $cpan_file\n";
+ }
+ else {
+ print $outfh
+ " Blead customization missing: $cpan_file $relative_mapped_file\n";
+ }
+ }
+ elsif ($verbose) {
+ if ( $cpan_file eq $relative_mapped_file ) {
+ print $outfh " Unchanged: $cpan_file\n";
+ }
+ else {
+ print $outfh
+ " Unchanged: $cpan_file $relative_mapped_file\n";
+ }
+ }
+ }
+ for ( sort keys %perl_unseen ) {
+ my $relative_mapped_file = relatively_mapped($_);
+ if ( customized( $m, $relative_mapped_file ) ) {
+ print $outfh " Customized for blead: $_\n";
+ }
+ else {
+ print $outfh " Perl only: $_\n" unless $use_diff;
+ }
+ }
+ if ( $verbose ) {
+ foreach my $exclude (@$excluded) {
+ my $seen = 0;
+ foreach my $cpan_file (@cpan_files) {
+ # may be a simple string to match exactly, or a pattern
+ if ( ref $exclude ) {
+ $seen = 1 if $cpan_file =~ $exclude;
+ }
+ else {
+ $seen = 1 if $cpan_file eq $exclude;
+ }
+ last if $seen;
+ }
+ if ( not $seen ) {
+ print $outfh " Unnecessary exclusion: $exclude\n";
+ }
+ }
+ }