mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1004 B

  1. #!/usr/bin/perl -w
  2. use English;
  3. use strict;
  4. if (not defined $ARGV[0] or not chdir $ARGV[0]) {
  5. print "\nUsage: $0 rootdir\n\n";
  6. print "E.g.: $0 build/ref0818-2.1.0-DEV-x86-reference-expert\n\n";
  7. exit 1;
  8. }
  9. my %baddirs;
  10. my %badcount;
  11. my %badpkgs;
  12. while (<var/adm/dep-debug/*>) {
  13. /.*\/(\S+)/;
  14. my $p = $1;
  15. my %dirdep;
  16. my %filedep;
  17. open P, $_ or die $!;
  18. while (<P>) {
  19. chomp;
  20. my ($d, $f) = split /: /;
  21. next if $d =~ /-dirtree$/;
  22. if (-d $f) {
  23. $dirdep{$d}{$f} = 1;
  24. } else {
  25. $filedep{$d} = 1;
  26. }
  27. }
  28. close P;
  29. foreach (keys %filedep) {
  30. delete $dirdep{$_};
  31. }
  32. foreach my $d (keys %dirdep) {
  33. foreach (keys %{$dirdep{$d}}) {
  34. $baddirs{$d}{$_}++;
  35. $badpkgs{$d}{$p}++;
  36. }
  37. $badcount{$d}++;
  38. }
  39. }
  40. foreach my $d (keys %badcount) {
  41. print "\nFound pure dir dependencies to $d ($badcount{$d}):\n";
  42. foreach (keys %{$badpkgs{$d}}) {
  43. print "\tpkg\t$badpkgs{$d}{$_}\t$_\n";
  44. }
  45. foreach (keys %{$baddirs{$d}}) {
  46. print "\tdir\t$baddirs{$d}{$_}\t$_\n";
  47. }
  48. }
  49. print "\n";
  50. exit 0;