<feed xmlns='http://www.w3.org/2005/Atom'>
<title>buildroot/support/scripts/graph-depends, branch 2018.02</title>
<subtitle>OpenPOWER buildroot sources</subtitle>
<id>https://git.raptorcs.com/git/buildroot/atom?h=2018.02</id>
<link rel='self' href='https://git.raptorcs.com/git/buildroot/atom?h=2018.02'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/'/>
<updated>2018-01-29T22:14:24+00:00</updated>
<entry>
<title>graph-depends: fix code style</title>
<updated>2018-01-29T22:14:24+00:00</updated>
<author>
<name>Ricardo Martincoski</name>
<email>ricardo.martincoski@gmail.com</email>
</author>
<published>2018-01-22T00:44:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=9ff44852c4fa3df081ec19b14ec5ee9db8d366c0'/>
<id>urn:sha1:9ff44852c4fa3df081ec19b14ec5ee9db8d366c0</id>
<content type='text'>
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 &lt;ricardo.martincoski@gmail.com&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/scripts: fix shebang with python</title>
<updated>2017-06-07T19:55:10+00:00</updated>
<author>
<name>Francois Perrad</name>
<email>fperrad@gmail.com</email>
</author>
<published>2017-06-07T19:10:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=ed0ce4953773c1d803edef50f567889ce8825f88'/>
<id>urn:sha1:ed0ce4953773c1d803edef50f567889ce8825f88</id>
<content type='text'>
Signed-off-by: Francois Perrad &lt;francois.perrad@gadz.org&gt;
Signed-off-by: Peter Korsgaard &lt;peter@korsgaard.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: rename pkgutil.py to brpkgutil.py</title>
<updated>2017-03-21T22:11:04+00:00</updated>
<author>
<name>Yegor Yefremov</name>
<email>yegorslists@googlemail.com</email>
</author>
<published>2017-03-21T08:22:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=3b627c89dc8adf8c60efd773935bf66004e8433d'/>
<id>urn:sha1:3b627c89dc8adf8c60efd773935bf66004e8433d</id>
<content type='text'>
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 &lt;yegorslists@googlemail.com&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: split off get_rdepends from get_depends</title>
<updated>2017-02-06T11:28:00+00:00</updated>
<author>
<name>Thomas De Schampheleire</name>
<email>thomas.de_schampheleire@nokia.com</email>
</author>
<published>2017-02-03T20:57:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=412e6c80ad56181546f29f2add405fa595116271'/>
<id>urn:sha1:412e6c80ad56181546f29f2add405fa595116271</id>
<content type='text'>
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 &lt;thomas.de_schampheleire@nokia.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: split off get_version/get_depends into pkgutil.py</title>
<updated>2017-02-06T11:26:55+00:00</updated>
<author>
<name>Thomas De Schampheleire</name>
<email>thomas.de_schampheleire@nokia.com</email>
</author>
<published>2017-02-03T20:57:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=12683184b1969f65680cb7db55b547a620a9860f'/>
<id>urn:sha1:12683184b1969f65680cb7db55b547a620a9860f</id>
<content type='text'>
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 &lt;thomas.de_schampheleire@nokia.com&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
[Thomas: remove shebang from pkgutil.py, noticed by Yann E. Morin.]
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: avoid use of global var 'rule' in get_depends</title>
<updated>2017-02-05T14:20:02+00:00</updated>
<author>
<name>Thomas De Schampheleire</name>
<email>thomas.de_schampheleire@nokia.com</email>
</author>
<published>2017-02-03T20:57:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=bd8b531d24431141a919daf6c50cca7de8547023'/>
<id>urn:sha1:bd8b531d24431141a919daf6c50cca7de8547023</id>
<content type='text'>
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 &lt;thomas.de_schampheleire@nokia.com&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>core/graph-depends: add option to graph reverse dependencies</title>
<updated>2016-10-25T20:59:05+00:00</updated>
<author>
<name>Yann E. MORIN</name>
<email>yann.morin.1998@free.fr</email>
</author>
<published>2016-10-23T17:19:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=2a2eb55ca73cbe8536a9d9bdd29feaf70a462961'/>
<id>urn:sha1:2a2eb55ca73cbe8536a9d9bdd29feaf70a462961</id>
<content type='text'>
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" &lt;yann.morin.1998@free.fr&gt;
Cc: Arnout Vandecappelle &lt;arnout@mind.be&gt;
Cc: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>support/scripts: fix graph-depends when run with python3</title>
<updated>2016-04-18T09:34:33+00:00</updated>
<author>
<name>Samuel Martin</name>
<email>s.martin49@gmail.com</email>
</author>
<published>2016-04-17T21:41:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=ac031cfb976980dd68dfb52e7b610b4e6e27fe17'/>
<id>urn:sha1:ac031cfb976980dd68dfb52e7b610b4e6e27fe17</id>
<content type='text'>
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 &lt;module&gt;
      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 &lt;s.martin49@gmail.com&gt;
Acked-by: Arnout Vandecappelle (Essensium/Mind) &lt;arnout@mind.be&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: add support for excluding host packages</title>
<updated>2016-02-08T20:29:06+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2016-01-27T20:32:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=ee8e4c5c250c3562f810d3b6102b9d9e7004082f'/>
<id>urn:sha1:ee8e4c5c250c3562f810d3b6102b9d9e7004082f</id>
<content type='text'>
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 &lt;thomas.petazzoni@free-electrons.com&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Reviewed-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
[Thomas: minor code beautification suggested by Yann E. Morin.]
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>graph-depends: fix handling of "virtual" in exclude_list</title>
<updated>2016-02-08T20:28:19+00:00</updated>
<author>
<name>Thomas Petazzoni</name>
<email>thomas.petazzoni@free-electrons.com</email>
</author>
<published>2016-01-27T20:32:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/buildroot/commit/?id=7771bb93b2a2b2b9ef6835785d51fb2bfe1ea584'/>
<id>urn:sha1:7771bb93b2a2b2b9ef6835785d51fb2bfe1ea584</id>
<content type='text'>
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 &lt;thomas.petazzoni@free-electrons.com&gt;
Tested-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Acked-by: "Yann E. MORIN" &lt;yann.morin.1998@free.fr&gt;
Signed-off-by: Thomas Petazzoni &lt;thomas.petazzoni@free-electrons.com&gt;
</content>
</entry>
</feed>
