Skip to contentSkip to conversation

Graphing package dependencies

Buildroot Thomas Petazzoni 3 participants 6 messages May 6, 2010 – May 17, 2010

lore
Share & tools
lore
#0 lore raw

Hello,

Following the question asked by Will yesterday, I just went ahead and implement a small tool that generates a graph of dependencies for a given package.

The result of this tool for the libgtk2 package can be seen at

http://free-electrons.com/~thomas/libgtk2-package-dependencies.pdf

This is the kind of funny things we can do with a generic package infrastructure :-)

The implementation of this tool is available in my graph-dependencies branch at
http://git.buildroot.net/~tpetazzoni/git/buildroot/log/?h=graph-dependencies.
There are three commits in this branch:

* package: Add new <pkg>-show-depends to list dependencies

http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?h=graph-dependencies&id=27ad37038055e5af12546a5941099264f37feecc

* package: optimize the implementation of UPPERCASE

http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?h=graph-dependencies&id=b6a46aaed9e497503b66789d1b212473d7c78b58

* New graph-depends script

http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?h=graph-dependencies&id=99c53bd52389c003707335d454d1bd1cace9ebfb

Regards,

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#1 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Thomas> Hello,
Thomas> Following the question asked by Will yesterday, I just went ahead and Thomas> implement a small tool that generates a graph of dependencies for a Thomas> given package.

Thomas> The result of this tool for the libgtk2 package can be seen at

Thomas> http://free-electrons.com/~thomas/libgtk2-package-dependencies.pdf

Thomas> This is the kind of funny things we can do with a generic package Thomas> infrastructure :-)

Nice!

Thomas> * package: optimize the implementation of UPPERCASE

Thomas> http://git.buildroot.net/~tpetazzoni/git/buildroot/commit/?h=graph-dependencies&id=b6a46aaed9e497503b66789d1b212473d7c78b58

My eyes! ;)

We could instead do something like gmsl does (http://gmsl.sf.net):

az := a b c d e f g h i j k l m n o p q r s t u v w x y z . - AZ := A B C D E F G H I J K L M N O P Q R S T U V W X Y Z _ _

UPPERCASE = $(eval __tmp := $1) \
     $(foreach c, $(join $(addsuffix :,$(az)),$(AZ)), \
	$(eval __tmp :=	\
		$(subst $(word 1,$(subst :, ,$c)),$(word 2,$(subst :, ,$c)),\
			$(__tmp)))) \
     $(__tmp)

It loops through a character list of the form a:A b:B .., and substitutes the 1st charact for the second.

This is written as a generic tr function, we could ofcourse merge az and A-Z if we only ever want to do uppercase.

Signature · 1 line
Bye, Peter Korsgaard
#2 lore raw
In reply to Thomas Petazzoni

Hello,

Quoted 3 lines · On Thu, 6 May 2010 10:14:37 +0200 Thomas Petazzoni…

Following the question asked by Will yesterday, I just went ahead and implement a small tool that generates a graph of dependencies for a given package.

I've slightly improved this script, and it is now capable of generating the dependency graph for a full Buildroot configuration, i.e taking into account all packages that have been selected.

See http://free-electrons.com/~thomas/buildroot-full-dependencies.pdf
for a fairly large example involving X.org and Gtk.

As always, the code is available in
http://git.buildroot.net/~tpetazzoni/git/buildroot/log/?h=graph-dependencies.
Besides the modifications in the script itself, the modifications in the rest of Buildroot are very small.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
#3 lore raw

\o/ Wunderbar !

Quoted 32 lines · Thomas Petazzoni

Hello,

Quoted 3 lines · On Thu, 6 May 2010 10:14:37 +0200 Thomas Petazzoni…

Following the question asked by Will yesterday, I just went ahead and implement a small tool that generates a graph of dependencies for a given package.

I've slightly improved this script, and it is now capable of generating the dependency graph for a full Buildroot configuration, i.e taking into account all packages that have been selected.

See http://free-electrons.com/~thomas/buildroot-full-dependencies.pdf
for a fairly large example involving X.org and Gtk.

As always, the code is available in
http://git.buildroot.net/~tpetazzoni/git/buildroot/log/?h=graph-dependencies.
Besides the modifications in the script itself, the modifications in the rest of Buildroot are very small.

Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
_______________________________________________
buildroot mailing list
buildroot at busybox.net
http://lists.busybox.net/mailman/listinfo/buildroot

#4 lore raw
In reply to Thomas Petazzoni
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Thomas" == Thomas Petazzoni <[email protected]> writes:

Hi,

Thomas> I've slightly improved this script, and it is now capable of generating Thomas> the dependency graph for a full Buildroot configuration, i.e taking Thomas> into account all packages that have been selected.

Thomas> See http://free-electrons.com/~thomas/buildroot-full-dependencies.pdf
Thomas> for a fairly large example involving X.org and Gtk.

Thomas> As always, the code is available in
Thomas> http://git.buildroot.net/~tpetazzoni/git/buildroot/log/?h=graph-dependencies.
Thomas> Besides the modifications in the script itself, the modifications in Thomas> the rest of Buildroot are very small.

Great! Care to write a bit of documentation about it, then I'll pull it?

Signature · 1 line
Bye, Peter Korsgaard
#5 lore raw
Quoted 1 line · On Mon, 17 May 2010 08:46:06 +0200 Peter Korsgaard <[email protected]> wrote:

Great! Care to write a bit of documentation about it, then I'll pull it?

Sure, will do.

Thomas

Signature · 4 lines
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com