Re: generate a dependencies list
Hello!
That's exactly what I've already tried. :-) See... I've reported that in my
previous email. The problem is that it gives the complete dependency list
(and I can parse that), but I couldn't figure out how to discover what a
virtual package (reported between < and > by apt-cache) depends on.
I've done this in shell script:
GEN_LIST=/file/with/the/list
function depends() {
DEPS=`apt-cache depends $1 | grep Depends | cut -f 2 -d ':'`;
for PKG in $DEPS; do
if [ ! `grep $PKG $GEN_LIST` ]; then
echo $PKG >> $GEN_LIST;
cat $GEN_LIST | sort -u > $GEN_LIST.2;
mv $GEN_LIST.2 $GEN_LIST;
depends $PKG;
fi
done
}
It works, but I still have to figure out how to treat virtual packages (such
as awk).
[]s
Pablo
Em Seg 12 Mai 2003 22:26, Matthew P. McGuire escreveu:
| On Mon, May 12, 2003 at 08:28:01PM -0300, Pablo Lorenzzoni wrote:
| > Hello!
| >
| > I was wondering... how to generate a list of dependencies of a given
| > package?
| >
| > dpkg --status <package> | grep "^Depends" get only the installed ones
| >
| > apt-cache depends <package> | Grep "Depends" gives the names of the
| > virtual packages, whose dependencies I cannot determine.
| >
| > I am kind of stuck... can somebody help me? The solution should be easy
| > enough to be used in a script.
|
| Try 'apt-cache depends PkgName' and you should get a list of the
| dependancies. I am not entirely sure how you can manipulate the results.
|
| Luck,
| --
| Matthew P. McGuire <gray AT shadowglade.net> 1024D/E21C0E88
| CB82 7859 26B2 95E3 1328 5198 D57A D072 E21C 0E88
| When choice matters, choose Debian.
--
Pablo Lorenzzoni (Spectra) <spectra@debian.org>
GnuPG Key ID 268A084D at search.keyserver.net
Webpage: http://people.debian.org/~spectra/
Reply to: