summaryrefslogtreecommitdiffstats
path: root/support/scripts/graph-depends
Commit message (Collapse)AuthorAgeFilesLines
* support/scripts/graph-depends: introduce MANDATORY_DEPS arrayThomas Petazzoni2018-12-061-1/+6
| | | | | | | | | This array will be re-used in another function in a follow-up commit, so it makes sense to factor it out. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/scripts/graph-depends: use proper rootpkg in remove_extra_deps()Thomas Petazzoni2018-12-061-4/+4
| | | | | | | | | | | | | | | | | | | | | The remove_extra_deps() function removes dependencies that we are not interested in seeing in the dependency graph. It does this for all packages, except the 'all' package, which on full dependency graphs is the root of the tree. However, this doesn't take into account package-specific dependency graphs (i.e make <pkg>-graph-depends) where the root is not 'all', but '<pkg>'. Due to this, dependencies on "mandatory deps" were not visible at all, i.e the toolchain package (and its dependencies) and the skeleton package (and its dependencies) were not displayed in package-specific dependency graphs. To fix this, we use the existing rootpkg variable instead of hardcoding 'all'. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/graph-depends: drop legacy target-exceptionsYann E. MORIN2018-12-061-9/+0
| | | | | | | | | | | | | | | | | | | | | | | | Currently, we avoid drawing the dependencies that we call 'target exceptions', becasue they initially were returned by 'show-targets', when they in fact were not really packages and thus should not be on the graph. However, those two exceptions have no longer been reported in the output of show-targets since we merged very old initial top-level parallel build way back in 2014, with commit a24877586a56 (Makefile: add support for top-level parallel make), where they had been converted into purely internal rules. 4 years have passed, we can now drop those exceptions from the graph-depends script. This concludes the cleanup initiated three years ago with commit 0b32791f0076 (graph-depends: remove absent targets from TARGET_EXCEPTIONS). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/graph-depends: fix package names starting with a non-alphaYann E. MORIN2018-11-241-2/+3
| | | | | | | | | | | | | | | | Graphviz' dot utility does not like nodes which names does not start with an ^[[:alpha:]], i.e. 18xx-ti-utils would cause grievance: Warning: syntax ambiguity - badly delimited number '18x' in line 4 [...]/graph-depends.dot splits into two tokens Warning: syntax ambiguity - badly delimited number '18x' in line 5 [...]/graph-depends.dot splits into two tokens Warning: syntax ambiguity - badly delimited number '18x' in line 6 [...]/graph-depends.dot splits into two tokens Warning: syntax ambiguity - badly delimited number '18x' in line 7 [...]/graph-depends.dot splits into two tokens Prefix nodes with an underscore to fix that. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
* support/scripts/graph-depends: add --flat-list optionGeorge Redivo2018-04-011-7/+19
| | | | | | | | | | | | | | | | | | graph-depends currently spits out a graph in .dot format. However, as part of the upcoming introduction of <pkg>-show-recursive-depends and <pkg>-show-recursive-rdepends, we need graph-depends to be able to display a flat list. Signed-off-by: George Redivo <george.redivo@datacom.ind.br> [Thomas: - Rebase on top of graph-depends changes - Do not display the package name itself in the list, only its dependencies (or reverse dependencies) - Display the result on a single line, instead of one package per line, in order to match what <pkg>-show-depends and <pkg>-show-rdepends are doing today.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support/scripts/graph-depends: add --quiet optionPeter Korsgaard2018-04-011-1/+3
| | | | | | | | | This will be useful for the upcoming recursive show-depends and show-rdepends features. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support/scripts/graph-depends: use the standard python logging modulePeter Korsgaard2018-04-011-6/+10
| | | | | | | | | Instead of hardcoded sys.stderr.write() calls. No functional change, but allows us to easily implement a quiet option. Signed-off-by: Peter Korsgaard <peter@korsgaard.com> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support/scripts/graph-depends: use colors instead of coloursThomas Petazzoni2018-04-011-8/+8
| | | | | | | | | | | | | | | | The graph-depends was not very consistent in colors vs. colours: some parts were using colours, some parts were using colors. Let's settle on the US spelling, colors. This change the user-visble option --colours to --colors, but it is unlikely that a lot of users customize the colors through BR2_GRAPH_DEPS_OPTS, so this user interface change is considered reasonable. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* support/scripts/graph-depends: remove global code and most global variablesThomas Petazzoni2018-04-011-145/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The graph-depends script had no main() function, and the main code was actually spread between the function definitions, which was a real mess. This commit moves the global code into a main() function, which allows to more easily follow the flow of the script. The argument parsing code is moved into a parse_args() function. Most of the global variables are removed, and are instead passed as argument when appropriate. This has the side-effect that the print_pkg_deps() function takes a lot of argument, but this is considered better than tons of global variables. The global variables that are removed are: max_depth, transitive, mode, root_colour, target_colour, host_colour, outfile, dict_deps, dict_version, stop_list, exclude_list, arrow_dir. The root_colour/target_colour/host_colour variables are entirely removed, and instead a single colours array is passed, and it's the function using the colors that actually uses the different entries in the array. The way the print_attrs() function determines if we're display the root node is not is changed. Instead of relying on the package name and the mode (which requires passing the root package name, and the mode), it relies on the depth: when the depth is 0, we're at the root node. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* graph-depends: fix code styleRicardo Martincoski2018-01-291-26/+42
| | | | | | | | | | | | | | | | | | | Fix these warnings: E122 continuation line missing indentation or outdented E127 continuation line over-indented for visual indent E128 continuation line under-indented for visual indent E202 whitespace before ']' E221 multiple spaces before operator E225 missing whitespace around operator E231 missing whitespace after ',' E302 expected 2 blank lines, found 1 E305 expected 2 blank lines after class or function definition, found 1 E502 the backslash is redundant between brackets E713 test for membership should be 'not in' Signed-off-by: Ricardo Martincoski <ricardo.martincoski@gmail.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: fix shebang with pythonFrancois Perrad2017-06-071-1/+1
| | | | | Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* graph-depends: rename pkgutil.py to brpkgutil.pyYegor Yefremov2017-03-211-4/+4
| | | | | | | | | | | | pkgutil.py is also part of Python itself. Placing pkgutil.py as is in a folder with other scripts that require original pkgutil will break them. This is the case with scanpypi. So rename pkgutil.py to brpkgutil.py to avoid naming collision. Fixes: https://bugs.busybox.net/show_bug.cgi?id=9766 Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: split off get_rdepends from get_dependsThomas De Schampheleire2017-02-061-3/+3
| | | | | | | | | | | | | | The use of a 'rule' variable that can contain 'show-depends' or 'show-rdepends' is not logical if get_depends is considered as a reusable function from various scripts. The name of these rules are too much an implementation detail. Therefore, split the existing get_depends into two separate functions get_depends and get_rdepends, while keeping code duplication to a minimum. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: split off get_version/get_depends into pkgutil.pyThomas De Schampheleire2017-02-061-51/+4
| | | | | | | | | | | Functions to obtain the version and dependencies of a package from Python can be useful for several scripts. Extract this logic out of graph-depends into pkgutil.py. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: remove shebang from pkgutil.py, noticed by Yann E. Morin.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: avoid use of global var 'rule' in get_dependsThomas De Schampheleire2017-02-051-2/+2
| | | | | | | | | | | | | | Function get_depends was recently changed to support both normal dependencies as reverse dependencies, via a global variable 'rule' that equals 'show-depends' or 'show-rdepends'. As a subsequent function will extract this function get_depends to a separate file, the use of globals is problematic. Instead, pass the global as an argument. Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* core/graph-depends: add option to graph reverse dependenciesYann E. MORIN2016-10-251-2/+16
| | | | | | | | | | | | | | Now that we can dump the reverse dependencies of a package, add the ability to graph those. It does not make sense to do a full reverse graph, as it would be semantically equivalent to the direct graph. So we only provide a per-package reverse graph. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/scripts: fix graph-depends when run with python3Samuel Martin2016-04-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make graph-depends script opening the output file in text mode since only ascii characters will be written. This change fixes the following error occuring when the default host python interpreter is python3: make: Entering directory '/opt/buildroot' Getting targets Getting dependencies for ['toolchain-external', 'toolchain', 'busybox', ...] Getting dependencies for ['host-python3', 'host-pkgconf', 'host-gettext', ...] Getting dependencies for ['host-libxml2', 'host-swig', 'host-m4', ...] Getting version for ['toolchain-external', 'toolchain', 'busybox', ...] Traceback (most recent call last): File "/opt/buildroot/support/scripts/graph-depends", line 425, in <module> outfile.write("digraph G {\n") TypeError: a bytes-like object is required, not 'str' Makefile:807: recipe for target 'graph-depends' failed make[1]: *** [graph-depends] Error 1 Makefile:84: recipe for target '_all' failed make: *** [_all] Error 2 make: Leaving directory '/opt/buildroot' While with python2, adding 'b' to the openning mode has no effect on Linux (c.f. [2]), the above error is expected with python3 (c.f. [1]). Therefore, just open the outfile in default (i.e. text) mode. [1] https://docs.python.org/3/library/functions.html#open [2] https://docs.python.org/2/library/functions.html#open Signed-off-by: Samuel Martin <s.martin49@gmail.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: add support for excluding host packagesThomas Petazzoni2016-02-081-2/+8
| | | | | | | | | | | | | | Just like the --stop-on and --exclude options allow to stop on or exclude virtual packages from the list by passing the "virtual" magic value, this commit extends the graph-depends logic to support a "host" magic value for --stop-on and --exclude. This will allow to draw the graph by stopping on host packages, or by excluding host packages. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> [Thomas: minor code beautification suggested by Yann E. Morin.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: fix handling of "virtual" in exclude_listThomas Petazzoni2016-02-081-4/+3
| | | | | | | | | | | | | | | | | | | | | The condition to determine if a virtual package should be excluded from the list due to "virtual" being passed in --exclude is under a loop iterating over each entry of the exclude_list, but it doesn't use the iterator of this list. Indeed, the condition contains: "virtual" in exclude_list which checks automatically if "virtual" was passed in the list. Due to this, there is no need for this check to be within the "for p in exclude_list" iteration. This commit fixes that by moving the check outside of the loop. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: teach it to only check dependenciesYann E. MORIN2016-02-071-0/+10
| | | | | | | | | | Add an option to graph-depends to only do the dependency checks and not generate the dot program. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: detect circular dependenciesYann E. MORIN2016-02-071-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if there is a circular dependency in the packages, the graph-depends script just errors out with a Python RuntimeError which is not caught, resulting in a very-long backtrace which does not provide any hint as what the real issue is (even if "RuntimeError: maximum recursion depth exceeded" is a pretty good hint at it). We fix that by recursing the dependency chain of each package, until we either end up with a package with no dependency, or with a package already seen along the current dependency chain. We need to introduce a new function, check_circular_deps(), because we can't re-use the existing ones: - remove_mandatory_deps() does not iterate, - remove_transitive_deps() does iterate, but we do not call it for the top-level package if it is not 'all' - it does not make sense to use those functions anyway, as they were not designed to _check_ but to _act_ on the dependency chain. Since we've had time-related issues in the past, we do not want to introduce yet another time-hog, so here are timings with the circular dependency check: $ time python -m cProfile -s cumtime support/scripts/graph-depends [...] 28352654 function calls (20323050 primitive calls) in 87.292 seconds Ordered by: cumulative time ncalls tottime percall cumtime percall filename:lineno(function) 1 0.012 0.012 87.292 87.292 graph-depends:24(<module>) 21 0.000 0.000 73.685 3.509 subprocess.py:473(_eintr_retry_call) 7 0.000 0.000 73.655 10.522 subprocess.py:768(communicate) 7 73.653 10.522 73.653 10.522 {method 'read' of 'file' objects} 5/1 0.027 0.005 43.488 43.488 graph-depends:164(get_all_depends) 5 0.003 0.001 43.458 8.692 graph-depends:135(get_depends) 1 0.001 0.001 25.712 25.712 graph-depends:98(get_version) 1 0.001 0.001 13.457 13.457 graph-depends:337(remove_extra_deps) 1717 1.672 0.001 13.050 0.008 graph-depends:290(remove_transitive_deps) 9784086/2672326 5.079 0.000 11.363 0.000 graph-depends:274(is_dep) 2883343/1980154 2.650 0.000 6.942 0.000 graph-depends:262(is_dep_uncached) 1 0.000 0.000 4.529 4.529 graph-depends:121(get_targets) 2883343 1.123 0.000 1.851 0.000 graph-depends:246(is_dep_cache_insert) 9784086 1.783 0.000 1.783 0.000 graph-depends:255(is_dep_cache_lookup) 2881580 0.728 0.000 0.728 0.000 {method 'update' of 'dict' objects} 1 0.001 0.001 0.405 0.405 graph-depends:311(check_circular_deps) 12264/1717 0.290 0.000 0.404 0.000 graph-depends:312(recurse) [...] real 1m27.371s user 1m15.075s sys 0m12.673s The cumulative time spent in check_circular_deps is just below 0.5s, which is largely less than 1% of the total run time. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: add option to specify output fileYann E. MORIN2016-02-071-6/+13
| | | | | | | | | | | | | | | | | | | | | Currently, graph-depends outputs the dotfile program to stdout, and uses stderr to trace the dependencies it is currently looking for. Redirection was done because the output was directly piped into the dot program to generate the final PDF/SVG/... dependency graph, but that meant that an error in the graph-depends script was never caught (because shell pipes only return the final command exit status, and an empty dot program is perfectly valid so dot would not complain). Add an option to tell graph-depends where to store the generated dot program, and keep stdout as the default if not specified. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Samuel Martin <s.martin49@gmail.com> [Thomas: rename metavar from DOT_FILE to OUT_FILE for consistency with the rest of the new option naming.] Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: correct is_dep() commentPeter Korsgaard2015-12-291-1/+1
| | | | | | The uncached variant is called is_dep_uncached(), not is_dep_full(). Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* graph-depends: optimize remove_transitive_deps()Thomas Petazzoni2015-12-291-2/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For large configurations, the execution time of remove_transitive_deps() becomes really high, due to the number of nested loops + the is_dep() function being recursive. For an allyespackageconfig, the remove_extra_deps() function takes 334 seconds to execute, and the overall time to generate the .dot file is 6 minutes and 39 seconds. Here is a timing of the different graph-depends steps and the overall execution time: Getting dependencies: 42.5735 seconds Turn deps into a dict: 0.0023 seconds Remove extra deps: 334.1542 seconds Get version: 22.4919 seconds Generate .dot: 0.0197 seconds real 6m39.289s user 6m16.644s sys 0m8.792s By adding a very simple cache for the results of is_dep(), we bring down the execution time of the "Remove extra deps" step from 334 seconds to just 4 seconds, reducing the overall execution time to 1 minutes and 10 seconds: Getting dependencies: 42.9546 seconds Turn deps into a dict: 0.0025 seconds Remove extra deps: 4.9643 seconds Get version: 22.1865 seconds Generate .dot: 0.0207 seconds real 1m10.201s user 0m47.716s sys 0m7.948s Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Tested-by: Gustavo Zacarias <gustavo.zacarias@free-electrons.com> [yann.morin.1998@free.fr: - rename is_dep() to is_dep_uncached(), keep existig code as-is - add is_dep() as a cached-version of is_dep_uncached() - use constructs more conform with 2to3 - use exceptions (EAFP) rather than check-before-use (LBYL) to be more pythonist; that even decreases the duration yet a little bit more! ] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
* graph-depends: Strip skeleton from dependencyMaxime Hadjinlian2015-07-141-4/+5
| | | | | | | | skeleton being a mandatory dependency, we don't want all our packages to have a link back to that node, the graph would be awful. Signed-off-by: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Makefile: rename TARGETS to PACKAGESThomas Petazzoni2015-04-141-1/+1
| | | | | | | | | | For clarity, this commit renames the TARGETS variable to the more meaningful PACKAGES variable. Indeed, only packages (handled by one of the package infrastructures) should be listed in this variable, and not other random non-package targets. Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
* support/graph-depends: allow excluding virtual packagesYann E. MORIN2015-04-011-0/+4
| | | | | | | | | Like for --stop-on, make --exclude recognise the keyword 'virtual', to stop on virtual packages (as explained in the help...). Reported-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: add option to completely exclude a packageYann E. MORIN2015-03-311-2/+15
| | | | | | | | | | Similar to --stop-on, but also omits the package from the graph. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Francois Perrad <fperrad@gmail.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: accepts globs to stop on packageYann E. MORIN2015-03-311-2/+5
| | | | | | | | Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Francois Perrad <fperrad@gmail.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: add option to stop on specific packagesYann E. MORIN2015-03-311-1/+13
| | | | | | | | | | | | | | Add a new option to graph-depends, that users can set to stop the graph on a specific (set of) package(s). This accepts any actual package name, or the 'virtual' keyword to stop on virtual packages. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Francois Perrad <fperrad@gmail.com> Reviewed-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: remove absent targets from TARGET_EXCEPTIONSAlexey Brodkin2015-03-111-9/+0
| | | | | | | | | | | | | Most of targets listed in TARGET_EXCEPTIONS these days are long gone, so why still keep them? Most of those targets were removed in this commit: http://git.buildroot.net/buildroot/commit/?id=02b88600312554bf166f6cfd71f7f2ede783096a Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* graph-depends: display virtual package with italic styleFrancois Perrad2015-03-081-1/+29
| | | | | | | | | | 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>
* graph-depends: remove unnecessary redirect of stderrArnout Vandecappelle2014-06-291-2/+2
| | | | | | | | | | It hides any error messages reported by make. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: Samuel Martin <s.martin49@gmail.com> Tested-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: support calling from recursive makeArnout Vandecappelle2014-06-291-2/+2
| | | | | | | | | | | | | | | | | The graph-depends script calls make. If the outer make was called recursively, or if it was called with '-C <somedir>', then the environment will contain "MAKEFLAGS=w --". Therefore, the recursive make prints 'Entering' and 'Leaving' messages, which clobbers the output for dot. To avoid this, add "--no-print-directory" to the recursive make arguments. Since we require GNU make 3.81, we can be sure that this option is available. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends.py: support python3Arnout Vandecappelle2014-06-221-12/+12
| | | | | | | | | | | | | This patch is the result of 2to3. In addition, universal_newlines=True is added to the Popen calls. In python3, this makes sure that the output is decoded so that we get a string instead of a buffer object. Cc: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graphs/depends: do not draw transitive dependencies by defaultYann E. MORIN2014-06-131-1/+1
| | | | | | | | | | | | | | The transitive dependencies make the graphs barely readable for large configs, with a large number of packages. So, just switch to not drawing the transitive dependencies by default. By popular demand... ;-) [Peter: reword] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc; Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
* graph-depends: rename the mode constantsYann E. MORIN2014-06-081-12/+8
| | | | | | | | | | | | This is ugly, since Python does not have enum constructs, so by moving the 'type' of the constant ('MODE' here) to the beginning, we get an artificial 'namespace' for the constants. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: document the 'transitive' variableYann E. MORIN2014-06-081-0/+3
| | | | | | | | | | | Although unnecessary (we already have initialisation via the parser), initialise the 'transitive' option, and document it at the same time. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: add option to set the coloursYann E. MORIN2014-06-081-3/+20
| | | | | | 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>
* graph-depends: handle the depth argument in a more pythonic wayYann E. MORIN2014-06-081-4/+5
| | | | | | | | | | | | Add some comment as well, enhance help text. [thanks to Samuel for the hints to make it even more pythonic] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graphs-depends: merge redundant-dependencies eliminationYann E. MORIN2014-06-081-37/+9
| | | | | | | | | | | | | | | | | | | Merge the redundant-dependencies elimination into the newly introduced transitive-dependencies elimination. This makes the code cleaner and much shorter, because: - the ('all',pkg) redundant dependency is in fact a transitive dependency, and we now have code to deal with that - the (pkg,'toolchain') dependency is easy enough to deal with that having a separate function for that is overkill Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graphs: add option to remove transitive dependencies in dependency graphYann E. MORIN2014-06-081-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, all the dependencies of a package are drawn on the dependency graph, including transitive dependencies (e.g. A->B->C and A->C). For very big graphs, with lots of packages with lots of dependencies, the dependency graph can be very dense, and transitive dependencies are cluttering the graph. In some cases, only getting the "build-order" dependencies is enough (e.g. to see what impact a package rebuild would have). Add a new environment variable to disable drawing transitive dependencies. Basically, it would turn this graph: pkg1 ---> pkg2 ---> pkg3 -------------------. |\__________/ \ \ |\____________________ \ \ | \ \ \ `-> pkg4 ---> pkg5 ---> pkg6 ---> pkg7 ---> pkg8 \__________/ into that graph: pkg1 ---> pkg2 ---> pkg3 -----------. | \ `-> pkg4 ---> pkg5 ---> pkg6 ---> pkg7 ---> pkg8 [Thanks to Samuel for the parser hints] Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Cc: Maxime Hadjinlian <maxime.hadjinlian@gmail.com> Cc: Samuel Martin <s.martin49@gmail.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* graph-depends: refactor with more colorsFrancois Perrad2014-06-081-7/+14
| | | | | | | | | Do not use the same colors for toolchain, host and target packages. Signed-off-by: Francois Perrad <francois.perrad@gadz.org> [yann.morin.1998@free.fr rephrase commit log] Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graphs: fix comparisons agains NoneYann E. MORIN2014-04-141-4/+4
| | | | | | | | | | | | | As Samuel said: In Python, None is a singleton, and it is recommended to use "is" or "is not" for testing them [1]. [1] http://legacy.python.org/dev/peps/pep-0008/#programming-recommendations Reported-by: Samuel Martin <s.martin49@gmail.com> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: don't show toolchain dependency for all packagesYann E. MORIN2014-04-141-2/+5
| | | | | | | | | | | | | Al packages depend on 'toolchain'. Currently, 'graph-depends' graphs this dependency. The resulting graph is thus cluttered with less-than-useful information. Instead, do not graph the 'toolchain' dependency for any package, save for the fake 'all' package. The graph is now a bit more readable. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: add option to limit the depth of the graphYann E. MORIN2014-04-141-12/+37
| | | | | | | | | | | | | | | | Currently, the complete dependency chain of a package is used to generate the dependency graph. When this dependency chain is long, the generated graph becomes almost unreadable. However, it is often sufficient to get the first few levels of dependency of a package. Add a new variable BR2_GRAPH_DEPTH, that the user can set to limit the depth of the dependency list. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* support/graph-depends: use argparse to parse argv[]Yann E. MORIN2014-04-141-10/+13
| | | | | | | | | | | | | | | Currently, we are using a crude, ad-hoc parsing of argv[]. This is a limiting factor to adding new options. Use argparse instead, and introduce a single argument for now: --package, -p PACKAGE In the (near) future, we'll be able to add more option arguments, such as depth-limiting for big graphs. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
* Merge branch 'next'Peter Korsgaard2013-06-021-0/+1
|\
| * skeleton: add default login port to /etc/securettyTzu-Jung Lee2013-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We ran into a "Login incorrect" problem when running the same rootfs image across platforms with different loging ports ttyS0/1/2/3. Simply assignning "console" to BR2_TARGET_GENERIC_GETTY_PORT, which in turn modifies the /etc/inittab, is not enough because the "console" device was missing in the /etc/securetty. While current securetty has enumerated a lot of ttys, this patch should save some efforts to enumerate more. [Peter: guard with single quotes] Signed-off-by: Tzu-Jung Lee <tjlee@ambarella.com> Signed-off-by: Spenser Gilliland <spenser@gillilanding.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* | graph-depends: ignore the 'target-purgelocales' targetDanomi Manchego2013-05-161-0/+1
| | | | | | | | | | | | | | | | Otherwise, graph-depends tries to call 'make target-purgelocales-show-depends', which does not exist, as 'target-purgelocales' is not an actual package. Signed-off-by: Danomi Manchego <danomimanchego123@gmail.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
OpenPOWER on IntegriCloud