Hi
On Sun, 12 Nov 2000, Tom Berkley wrote:
> Thanks. Next time someone needs the files in the directory
> /usr/X11R6/lib/modules/extensions/, all they have to do is install the
> XFree86-server rpm. Pretty simple? (Please don't go spanking me, I'm not
> whacking on you, honest, just making a point for a few other people)
> This should be a little motivation to learn more about the rpm command
> and Maximum RPM is a good book if you want to take the time. The only
> problem with rpm is that there is no database yet to tell us where
> certain files are for rpms that we do not have installed on a system.
> When that arrives, we will have a very simple job of finding things.
>
> With a mandrake cd you can go to the rpm directory and use the following
> command,
>
> rpm -qpl *.rpm | grep for_something
>
> but when you do this you do not see the package that the file was in.
> Will not take much work to write a little program to put the 'rpm -qpl'
> info into a database and then another simple command to get it out and
> then Mandrake/Redhat could put the database on the installation cd and
> load it with the install. Voila. Major problem is fixed.
>
> In the interim, you can 'rpm -qpl *.rpm >rpmqpl.out' and then use and
> editor or more or less to look for the key words in the rpmqpl.out file.
> Just above the result will be the name of the rpm that you want.
>
> Thanks for the opportunity to think out loud (writing actually :))
>
> Tom Berkley
As you mentioned before, that command fails to include the package name.
Maybe it is possible to do so with th rpm command itself. the manpage
mentions a format string in the query options, but I see nothing there
about the format of printing the file names. Perhaps this has changed with
newer versions of rpm (the man page is from 1998).
Anyway, a simple perl one-liner:
ls |perl -n -e 'chop;my $package=$_; $package =~ s/.i586.rpm$//; my @files=`rpm -qpl
$_ `; for $file (@files) {print "$package\t$file\n"}' > rpmqpl.out
If you want it to include files of a different directory, use a different
ls command.
But you can also try google's linux search, to search rpmfind's database.
It is not as relible, and not as fast as greping a text file, but try
searching in:
http://www.google.com/linux/
for:
rpm mandrake /bin/ls
The thing is that each record in rpmfind includes the list of files in
that database, and google regards rpmfind as an authorative source.
--
Tzafrir Cohen
mailto:[EMAIL PROTECTED]
http://www.technion.ac.il/~tzafrir
Keep in touch with http://mandrakeforum.com:
Subscribe the "[EMAIL PROTECTED]" mailing list.