How to find dependencies? (Solved)

Using applications, configuring, problems
Post Reply
Message
Author
scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

How to find dependencies? (Solved)

#1 Post by scsijon »

does anyone know an easy way of finding out how (many) packages require a particular package as prerequisite, both for running and building against?

I want to check for a gtk2 requirement against all of the current racy packages. A number will need rebuilding or updating for gtk3 compatability, even though gtk3 will be running in parallel to gtk2.

This will be the first step for a multi-engined puppy with all ?three (xorg plus xwayland plus pure-wayland) which can now be done with the latest kernels.

thanks
scsijon
the ?three is that when it works, we could also add any others that come along without reinventing the wheel.
Last edited by scsijon on Wed 12 Jun 2013, 23:16, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi, scijon.

Don't we have a dependency checker? Or are you wishing for something more robust?

Best regards.

musher0
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#3 Post by scsijon »

Hi musher0,

I need something 'deeper' that can both run alone from a prompt and can deal with more than just libs.

In some cases I expect to find something like "a 'file' (of any type) that is loaded by another lib when called by a applications lib which is stared by an application and any of them may use gtk2 by themselves.

I know it's going to be a pain, but to stop continually rebuilding an app and all it's dependancies (both direct and associated) and hitting brick walls, I need to be able to find them all in one hit.

I learnt that from building mage2 where mageia can split what we would leave as one package into many, and some of the names and descriptions don't make interpolative sense until you track it down.

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#4 Post by amigo »

This can only be done when a complete database of installed files exists. As you infer, info about library dependencies does not tell the whole story, so the database must contain maintainer-added info to cover non-lib depends info.

Accurately discovering lib dependencies can *only* be done at compile/packaging time, so trying to use depends info for other distros will not work.

Discovering reverse-dependencies relies on the complete info from above. If you have a list of everything each package needs, then you can easily find out which programs need a certain library by grepping through the files for all packages.

In short, there is *no way* to achieve this goal under any Puppy Linux -the info simply is not there.

scsijon
Posts: 1596
Joined: Thu 24 May 2007, 03:59
Location: the australian mallee
Contact:

#5 Post by scsijon »

that is what I feared, oh well, I shall have to do it the hard way!

thank you all

amigo
Posts: 2629
Joined: Mon 02 Apr 2007, 06:52

#6 Post by amigo »

By the 'hard way' you could only mean that you are first going to create or implement a packaging system which provides such info and then recompile everything on the system -in the correct order, of course...

I have done just this (created and use my own system), so I have lots of sympathy for you...

Here's an example of the results:

Code: Select all

 tpkg-reqs glib2
glibc_2.13-i586-4
zlib_1.2.6-i586-1
That shows us the exact packages which glib2 needs -and which it was compiled against. The info is stored in a file which is part of the installable package, and this info is preserved at install time by adding the file to the package database. The packages are created by src2pkg which allows for additonal arbitrary dependency info to be added. src2pkg itself figures out the library depends, but can add arbitrary info which must be supplied by the packager (as part of the packages's build script).

Code: Select all

 tpkg-deps glib2
atk
autotrace
cairo
cssed
desktop-file-utils
flash-player
gconf
gdk-pixbuf2
geany
geany-plugins
gegl
gettext-tools
ghostscript
greq-gtk2
gselect-gtk2
gstpw
gtk+2
gworldclock
imagemagick
inkscape
lensfun
libcanberra
libgsf
libidl
librsvg
libwnck
mc
networkmanager
notification-daemon
orbit2
pango
pho
pkg-config
poppler
pygobject
pygtk
rawstudio
rox-filer
samplecat
scim
scim-anthy
scim-bridge
scim-hangul
scim-input-pad
scim-pinyin
scim-tables
seamonkey
shared-mime-info
xcdroast-gtk2
xdialog-gtk2
xzgv
This shows the currently installed packages which need glib2. This info is generated dynamically by grepping the database for all packages which state that they require glib2.

It's really very simple on this level, but it can only be achieved when *every* package supplies its' dependency info. And it can only be accurate when things are properly built or rebuilt in the correct order.

I also have tools which will calculate the order in which dependencies must be compiled:

Code: Select all

 tpkg-show_chain gtk2 
Package not installed: gtk2
It's hard to get here. 'gtk2' has no external dependencies.
amigo@kiss:~$ tpkg-show_chain gtk+2
glibc_2.13-i586-4
glib2_2.28.6-i586-2
atk_2.2.0-i586-1
zlib_1.2.6-i586-1
bzip2_1.0.6-i586-1
fontconfig_2.8.0-i586-2
freetype_2.4.8-i586-1
libX11_1.4.3-i586-1
libXrender_0.9.6-i586-1
libpng_1.4.9-i586-1
pixman_0.20.2-i586-1
cairo_1.10.2-i586-2
expat_2.0.1-i586-2
libXau_1.0.6-i586-1
libXdmcp_1.1.0-i586-1
libpthread-stubs_0.3-i586-1
cxxlibs-6.0.14_4.5.3-i586-4
or:

Code: Select all

 tpkg-show_chain --tree gtk+2
atk_2.2.0-i586-1
        glib2_2.28.6-i586-2
                glibc_2.13-i586-4
                zlib_1.2.6-i586-1
bzip2_1.0.6-i586-1
cairo_1.10.2-i586-2
        fontconfig_2.8.0-i586-2
                expat_2.0.1-i586-2
                freetype_2.4.8-i586-1
        libX11_1.4.3-i586-1
                libXau_1.0.6-i586-1
                libXdmcp_1.1.0-i586-1
                libxcb_1.7-i586-1
                        libpthread-stubs_0.3-i586-1
        libXrender_0.9.6-i586-1
        libpng_1.4.9-i586-1
        pixman_0.20.2-i586-1
cxxlibs-6.0.14_4.5.3-i586-4
The tpkg-show_chain script is still a little rough, but perhaps you get the idea. I even have a tool which will calculate the compile-order for the complete system.

Post Reply