File: list-os-in-perl-ostype-not-in-perl-osnames

package info (click to toggle)
libperl-osnames-perl 0.122-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 164 kB
  • sloc: perl: 178; makefile: 2
file content (34 lines) | stat: -rwxr-xr-x 886 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env perl

use strict;
use warnings;
use FindBin '$Bin';
use lib "$Bin/../lib";

use File::Slurper qw(read_text);
use Module::Path::More qw(module_path);
#use Perl::OSType;
use Perl::osnames;

print "os in Perl::OSType not yet in Perl::osnames:\n";
my $ostype_src = read_text(module_path(module => "Perl::OSType"));
my %ostype_os;
for my $line (split /^/m, $ostype_src) {
    $line =~ /^\s+([\w-]+)\s+\w+\s*$/ or next;
    $ostype_os{$1} = 1;
}
if ($ENV{DEBUG}) { use DD; dd \%ostype_os }

for my $os (sort keys %ostype_os) {
    print "  $os\n" unless grep { $_->[0] eq $os } @$Perl::osnames::data;
}
print "\n";

print "os in Perl::osnames no longert in Perl::OSType:\n";
for my $rec (@$Perl::osnames::data) {
    next if $ostype_os{ $rec->[0] };
    print "  $rec->[0]";
    print " (already tagged old)" if grep { $_ eq 'old' } @{$rec->[1]};
    print "\n";
}
print "\n";