rpm query of dependicies with tags example

Constance Sieh ([email protected])
Tue, 24 Nov 1998 13:55:15 -0600 (CST)

One needs to use [] on array items like REQUIRENAME. Here are a couple of
versions:

rpm -q -a | grep ghost | xargs rpm -q --queryformat "%-30{NAME} [%{REQUIRENAME}\n]"
ghostscript libm.so.6
libc.so.6
libXt.so.6
libXext.so.6
libX11.so.6
libSM.so.6
libICE.so.6
ld-linux.so.2
ghostscript-fonts
ghostscript-fonts ghostscript

If you want the package on each line, add a "=" iterator:

rpm -q -a | grep ghost | xargs rpm -q --queryformat "[%-30{=NAME} %{REQUIRENAME}\n]"
ghostscript libm.so.6
ghostscript libc.so.6
ghostscript libXt.so.6
ghostscript libXext.so.6
ghostscript libX11.so.6
ghostscript libSM.so.6
ghostscript libICE.so.6
ghostscript ld-linux.so.2
ghostscript ghostscript-fonts
ghostscript-fonts ghostscript

All the obscure info on RPM is in the Maximum RPM book. There's an
on-line version (postscript) available at a link at
http://linux-rep.fnal.gov/documentation.html

Don Holmgren

On Tue, 24 Nov 1998, Robert Kennedy wrote:

> Hello,
>
> I received the following question from Chris Green. I would like to see if we
> can find an answer locally before forwarding this to RedHat Support.
>
> Thanks,
> Rob K.
>
> ------------------------------------------
>
> Date: Mon, 23 Nov 1998 11:13:50 -0600 (EST)
> From: Chris Green <[email protected]>
> Subject: Query regarding rpm --queryformat and tags returning multiple words
> To: [email protected]
> Message-id: <[email protected]>
> MIME-version: 1.0
> Content-type: TEXT/PLAIN; charset=US-ASCII
> X-Authentication-warning: purpc03.fnal.gov: greenc owned process doing -bs
>
>
> Hi,
>
> I've been trying to get rpm to give me a formatted list of dependencies
> for a list of packages. I've been trying something like:
>
> rpm -q -a | grep ghost | xargs rpm -q --queryformat \
> "%-30{NAME} %{REQUIRENAME}\n"
>
> but this only lists the first dependency in each case. Can you tell me how
> to specify in the format how to deal with tags returning multiple words,
> as I can't seem to find appropriate instructions in the man page?
>
> Thanks,
> Chris.
>
>
> - --
> Chris Green. HEP, Purdue University. CDF SVXII project.
> Based at Fermilab. MAIL [email protected]; PHONE (630) 840-2308
>