aboutsummaryrefslogtreecommitdiff
path: root/src/tools/deptree2dot
diff options
context:
space:
mode:
authorWilliam Hubbs <w.d.hubbs@gmail.com>2017-02-17 12:06:03 -0600
committerWilliam Hubbs <w.d.hubbs@gmail.com>2017-02-17 12:06:03 -0600
commit6f614cd3f33dbdea3a67ac2fb414b1130674ee04 (patch)
tree70fd3cc0f4bff6e3fd3e55a8b3e5776fa7c30937 /src/tools/deptree2dot
parent85c1930acf15b0c9d3c5537fb2b0409c6a11c982 (diff)
Move deptree2dot to the support folder
Since deptree2dot and the perl requirement are completely optional, we can move this tool to the support folder. This gives the user the option of using it if they have perl installed, and means we do not have an optional runtime dependency on perl. Documentation for this tool has also been added to the support folder. X-Gentoo-Bug: 600742 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=600742
Diffstat (limited to 'src/tools/deptree2dot')
-rw-r--r--src/tools/deptree2dot44
1 files changed, 0 insertions, 44 deletions
diff --git a/src/tools/deptree2dot b/src/tools/deptree2dot
deleted file mode 100644
index 07ba17af..00000000
--- a/src/tools/deptree2dot
+++ /dev/null
@@ -1,44 +0,0 @@
-#!/usr/bin/perl -w
-# -*- cperl -*-
-# Copyright © 2012 Diego Elio Pettenò <flameeyes@flameeyes.eu>
-# Released under the 2-clause BSD license.
-#
-#Example usage:
-#deptree2dot > deptree.dot
-#deptree2dot | dot -Tpng -o deptree.png
-
-my $deptree = defined($ARGV[0]) ? $ARGV[0] : "/run/openrc/deptree";
-
-open DEPTREE, $deptree or exit 1;
-
-print "digraph deptree {\n";
-
-my @deptree;
-
-while(my $line = readline(DEPTREE)) {
- $line =~ /^depinfo_([0-9]+)_([a-z]+)(?:_[0-9]+)?='(.*)'\n$/;
- my $index = $1;
- my $prop = $2;
- my $value = $3; $value =~ s/[-\.:~]/_/g;
-
- if ( $prop eq "service" ) {
- $deptree[$index] = $value;
- printf "%s [shape=box];\n", $value;
- } else {
- my $service = $deptree[$index];
-
- if ( $prop eq "ineed" ) {
- printf "%s -> %s;\n", $service, $value;
- } elsif ( $prop eq "iuse" ) {
- printf "%s -> %s [color=blue];\n", $service, $value;
- } elsif ( $prop eq "ibefore" ) {
- printf "%s -> %s [style=dotted];\n", $service, $value;
- } elsif ( $prop eq "iafter" ) {
- printf "%s -> %s [style=dotted color=purple];\n", $value, $service;
- } elsif ( $prop eq "iprovide" ) {
- printf "%s -> %s [color=red];\n", $value, $service;
- }
- }
-}
-
-print "}\n";