1999-05-18 12:39:02 -04:00
|
|
|
#!/usr/bin/perl
|
|
|
|
$cache=1;
|
|
|
|
|
|
|
|
print "Dependency list\n";
|
|
|
|
print "---------------\n";
|
|
|
|
for $file (<*.tgz>)
|
|
|
|
{
|
|
|
|
$name = $file;
|
|
|
|
$name =~ s/\.tgz$//;
|
|
|
|
unless ($cache && -f "t/CONTENTS.$name")
|
|
|
|
{
|
1999-10-26 11:37:42 -04:00
|
|
|
system("tar zxqf $file +CONTENTS");
|
1999-05-18 12:39:02 -04:00
|
|
|
rename("+CONTENTS", "t/CONTENTS.$name");
|
|
|
|
}
|
|
|
|
open(FILE, "t/CONTENTS.$name") or die "No contents";
|
|
|
|
$deps{$name}=[];
|
|
|
|
while (<FILE>)
|
|
|
|
{
|
|
|
|
chomp;
|
|
|
|
if (m/^\@pkgdep\s+/)
|
|
|
|
{
|
|
|
|
push(@{$deps{$name}}, $');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
close(FILE);
|
|
|
|
print $name, ": ", join(',', @{$deps{$name}}), "\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
print "Checking topological order\n";
|
|
|
|
print "--------------------------\n";
|
|
|
|
# check recursive brokeness
|
|
|
|
while (($key, $value) = each %deps)
|
|
|
|
{
|
|
|
|
%pulled=();
|
|
|
|
for $np (@$value)
|
|
|
|
{
|
|
|
|
for $rec (@{$deps{$np}})
|
|
|
|
{
|
|
|
|
unless (defined $pulled{$rec})
|
|
|
|
{
|
|
|
|
print "Error: $key depends on $np which depends on $rec\n";
|
|
|
|
print "(", join(",", @$value), ")\n";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$pulled{$np} = 1;
|
|
|
|
}
|
|
|
|
}
|