summaryrefslogtreecommitdiffstats
path: root/support/scripts/graph-depends
diff options
context:
space:
mode:
authorYann E. MORIN <yann.morin.1998@free.fr>2014-06-08 16:03:49 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2014-06-08 16:43:17 +0200
commit61dbf4d30684b766731b9a7e09bbaec62874c772 (patch)
treea3d29199a87613c3fc47794ccc38815b5fbb8f5b /support/scripts/graph-depends
parente347bee02ca7696e17d482f163c999d8d705be7d (diff)
downloadbuildroot-61dbf4d30684b766731b9a7e09bbaec62874c772.tar.gz
buildroot-61dbf4d30684b766731b9a7e09bbaec62874c772.zip
graph-depends: add option to set the colours
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Francois Perrad <fperrad@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/scripts/graph-depends')
-rwxr-xr-xsupport/scripts/graph-depends23
1 files changed, 20 insertions, 3 deletions
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends
index 2b46040009..0dafd77389 100755
--- a/support/scripts/graph-depends
+++ b/support/scripts/graph-depends
@@ -42,6 +42,12 @@ parser.add_argument("--package", '-p', metavar="PACKAGE",
help="Graph the dependencies of PACKAGE")
parser.add_argument("--depth", '-d', metavar="DEPTH", dest="depth", type=int, default=0,
help="Limit the dependency graph to DEPTH levels; 0 means no limit.")
+parser.add_argument("--colours", "-c", metavar="COLOR_LIST", dest="colours",
+ default="lightblue,grey,gainsboro",
+ help="Comma-separated list of the three colours to use" \
+ + " to draw the top-level package, the target" \
+ + " packages, and the host packages, in this order." \
+ + " Defaults to: 'lightblue,grey,gainsboro'")
parser.add_argument("--transitive", dest="transitive", action='store_true',
default=True)
parser.add_argument("--no-transitive", dest="transitive", action='store_false',
@@ -58,6 +64,17 @@ max_depth = args.depth
transitive = args.transitive
+# Get the colours: we need exactly three colours,
+# so no need not split more than 4
+# We'll let 'dot' validate the colours...
+colours = args.colours.split(',',4)
+if len(colours) != 3:
+ sys.stderr.write("Error: incorrect colour list '%s'\n" % args.colours)
+ sys.exit(1)
+root_colour = colours[0]
+target_colour = colours[1]
+host_colour = colours[2]
+
allpkgs = []
# Execute the "make show-targets" command to get the list of the main
@@ -250,14 +267,14 @@ def print_attrs(pkg):
else:
label = pkg
if pkg == 'all' or (mode == PKG_MODE and pkg == rootpkg):
- color = 'lightblue'
+ color = root_colour
else:
if pkg.startswith('host') \
or pkg.startswith('toolchain') \
or pkg.startswith('rootfs'):
- color = 'gainsboro'
+ color = host_colour
else:
- color = 'grey'
+ color = target_colour
print "%s [label = \"%s\"]" % (name, label)
print "%s [color=%s,style=filled]" % (name, color)
OpenPOWER on IntegriCloud