Documentation/scripts/find-iso-orphans

23 lines
546 B
Perl
Executable File

#!/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"; }