/usr/share/pegasus/visualize/ant2dot.pl is in pegasus-wms 4.0.1+dfsg-8.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 | #!/usr/bin/env perl
#
# converts the dependencies in an ant build file into graphviz format
# $Id: ant2dot.pl 4494 2011-08-26 00:27:39Z rynge $
#
use 5.005;
use warnings;
use diagnostics;
use strict;
use XML::Parser::Expat;
my $buildfn = shift || 'build.xml';
my $parser = new XML::Parser::Expat() ||
die "ERROR: Unable to instantiate XML parser";
print 'digraph E {', "\n";
print ' size="16.0,11.0"', "\n";
print ' ratio = fill', "\n";
print ' node [fontname="Courier",shape=rectangle, color=lightblue, style=filled]', "\n";
my (%result,@stack,@deps,$name) = ();
$parser->setHandlers( 'Start' => sub {
my $self = shift;
my $element = shift;
my %attr = @_;
if ( $element eq 'target' ) {
# <target name="xxx" depends="y1,y2..." ...>
push( @stack, $attr{name} );
$name = '"' . $attr{name} . '"';
print " $name\n";
if ( exists $attr{depends} ) {
foreach my $dep ( split /,/, $attr{depends} ) {
print " $name->\"$dep\"\n";
}
}
} elsif ( $element eq 'antcall' ) {
# <antcall target="y"/>
$name = '"' . $stack[$#stack] . '"';
print " $name->\"", $attr{target}, "\" [ color=blue ]\n";
}
}, 'End' => sub {
my $self = shift;
my $element = shift;
pop(@stack) if $element eq 'target';
} );
$parser->parsefile($buildfn);
print "}\n";
|