--- quilt-0.32/scripts/dependency-graph 2004-06-05 13:55:17.000000000 -0500 +++ dependency-graph 2004-06-05 14:19:53.000000000 -0500 @@ -19,6 +19,7 @@ # Command line arguments my $help = 0; +my $use_patcher = 0; # Assume patcher format for metadata my $short_edge_thresh = 0; # threshold for coloring as "short", 0 = disable my $long_edge_thresh = 0; # threshold for coloring as "long",0 = disable my $edge_labels; # label all edges with filenames @@ -35,6 +36,7 @@ unless (GetOptions( "h|help" => \$help, + "patcher" => \$use_patcher, "short-edge=i" => \$short_edge_thresh, "long-edge=i" => \$long_edge_thresh, "edge-files" => \$edge_labels, @@ -52,11 +54,15 @@ $basename =~ s:.*/::; my $fd = $help ? *STDOUT : *STDERR; print $fd <; + $fh->close(); +} else { + my $fh = new FileHandle("< patches/series") + or die "patches/series: $!\n"; + @patches = map { chomp; s/\.diff$//; $_ } <$fh>; + $fh->close(); +} + +my @applied; +#load the list of applied patches +if ($use_patcher) { + my $fh = new FileHandle("< .patches/applied") + or die ".patches/applied: $!\n"; + @applied = map { chomp; $_ } <$fh>; + $fh->close(); } else { my $fh = new FileHandle("< .pc/applied-patches") or die ".pc/applied-patches: $!\n"; - @patches = map { chomp; $_ } <$fh>; + @applied = map { chomp; $_ } <$fh>; $fh->close(); + } # Fetch the list of files my @nodes; my $n = 0; foreach my $patch (@patches) { - if (! -d ".pc/$patch") { - print STDERR ".pc/$patch does not exist; skipping\n"; - next; + my @files; + my $fh; + if ($use_patcher) { + if (scalar(grep { $_ eq $patch } @applied) != 0) { + $fh = new FileHandle("< .patches/$patch.files") + or die ".patches/$patch.files: $!\n"; + @files = map { chomp; $_ } <$fh>; + $fh->close(); + } else { + $fh = new FileHandle("lsdiff --strip 1 .patches/$patch.patch|") + or die ".patches/$patch.patch: $!\n"; + @files = map { chomp; $_ } <$fh>; + $fh->close(); + } + } else { + if (scalar(grep { $_ eq $patch } @applied) != 0) { + if (! -d ".pc/$patch") { + print STDERR ".pc/$patch does not exist; skipping\n"; + next; + } + @files = split(/\n/, `cd .pc/$patch ; find -type f ! -name .timestamp`); + @files = map { s:\./::; $_ } @files; + } else { + $fh = new FileHandle("lsdiff --strip 1 patches/$patch.diff|") + or die "patches/$patch.diff $!\n"; + @files = map { chomp; $_ } <$fh>; + $fh->close(); + } } - my @files = split(/\n/, `cd .pc/$patch ; find -type f ! -name .timestamp`); - @files = map { s:\./::; $_ } @files; push @nodes, {number=>$n++, name=>$patch, file=>$patch, files=>[ @files ] }; }