Documentation/scripts/find-iso-orphans

23 lines
546 B
Plaintext
Raw Normal View History

2023-03-21 20:39:05 -04:00
#!/usr/bin/perl
use warnings; use strict;
my $depmap="/mnt/crux/setup.dependencies";
my @orphans; my %DEPENDS;
open (my $dfh, $depmap) or die "Cannot open dependency map $depmap!\n";
while (<$dfh>) {
$DEPENDS{$1} = $2 if m/(.*): (.*)/;
}
close ($dfh);
my $iso_deps="";
foreach my $port (keys %DEPENDS) {
$DEPENDS{$port} =~ s/ $port / /;
$iso_deps .= " $DEPENDS{$port} " if ($DEPENDS{$port} !~ /^\s*$/);
}
@orphans = grep { $iso_deps !~ / $_/ } keys %DEPENDS;
print "Orphans found on the iso:\n";
foreach (@orphans) { print "$_\n"; }