File: audit_hints.pl

package info (click to toggle)
libdevel-patchperl-perl 2.08-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 748 kB
  • sloc: perl: 7,948; ansic: 46; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 738 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use strict;
use warnings;
use feature qw[say];
use File::Spec;
use Devel::PatchPerl::Hints;
use MIME::Base64;
use Text::Diff;

my $path = shift || die "No Path specified to a perl source\n";
die "Not a perl repository\n" unless -d $path or -d File::Spec->catdir($path,'.git') or -d File::Spec->catdir($path,'hints');
my $hintsdir = File::Spec->catdir($path,'hints');

foreach my $os ( sort Devel::PatchPerl::Hints->hints() ) {
  my ($file,$data) = Devel::PatchPerl::Hints->hint_file( $os );
  $data = encode_base64( $data );
  my $fdata;
  {
    open my $fh, '<', File::Spec->catfile( $hintsdir, $file );
    local $/ = undef;
    $fdata = encode_base64(<$fh>)
  }
  chomp $fdata;
  say "'$os' =>\n'$fdata',"; #if diff \$data, \$fdata;
}