diff options
author | Francois Perrad <fperrad@gmail.com> | 2015-01-03 15:29:12 +0100 |
---|---|---|
committer | Thomas Petazzoni <thomas.petazzoni@free-electrons.com> | 2015-03-08 22:17:11 +0100 |
commit | ef0b091ca458770412adfdcc05fc3893434551dc (patch) | |
tree | 22459ff553d46c34e41e5572296b091c8c6c5a1d /support/scripts/graph-depends | |
parent | 7f57e79a7e61f5e7760e89bca9f466be139c693d (diff) | |
download | buildroot-ef0b091ca458770412adfdcc05fc3893434551dc.tar.gz buildroot-ef0b091ca458770412adfdcc05fc3893434551dc.zip |
graph-depends: display virtual package with italic style
virtual packages are found by their version,
so we retrieve the version of all packages
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Tested-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'support/scripts/graph-depends')
-rwxr-xr-x | support/scripts/graph-depends | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/support/scripts/graph-depends b/support/scripts/graph-depends index 1ecfedac7a..28fe2f0010 100755 --- a/support/scripts/graph-depends +++ b/support/scripts/graph-depends @@ -76,6 +76,28 @@ host_colour = colours[2] allpkgs = [] +# Execute the "make <pkg>-show-version" command to get the version of a given +# list of packages, and return the version formatted as a Python dictionary. +def get_version(pkgs): + sys.stderr.write("Getting version for %s\n" % pkgs) + cmd = ["make", "-s", "--no-print-directory" ] + for pkg in pkgs: + cmd.append("%s-show-version" % pkg) + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, universal_newlines=True) + output = p.communicate()[0] + if p.returncode != 0: + sys.stderr.write("Error getting version %s\n" % pkgs) + sys.exit(1) + output = output.split("\n") + if len(output) != len(pkgs) + 1: + sys.stderr.write("Error getting version\n") + sys.exit(1) + version = {} + for i in range(0, len(pkgs)): + pkg = pkgs[i] + version[pkg] = output[i] + return version + # Execute the "make show-targets" command to get the list of the main # Buildroot TARGETS and return it formatted as a Python list. This # list is used as the starting point for full dependency graphs @@ -257,6 +279,8 @@ def remove_extra_deps(deps): return deps dict_deps = remove_extra_deps(dict_deps) +dict_version = get_version([pkg for pkg in allpkgs + if pkg != "all" and not pkg.startswith("root")]) # Print the attributes of a node: label and fill-color def print_attrs(pkg): @@ -274,7 +298,11 @@ def print_attrs(pkg): color = host_colour else: color = target_colour - print("%s [label = \"%s\"]" % (name, label)) + version = dict_version.get(pkg) + if version == "virtual": + print("%s [label = <<I>%s</I>>]" % (name, label)) + else: + print("%s [label = \"%s\"]" % (name, label)) print("%s [color=%s,style=filled]" % (name, color)) # Print the dependency graph of a package |