Subject: Re: pkgdb - testers wanted
To: Christoph Badura <bad@ora.de>
From: Hubert Feyrer <feyrer@rfhs8012.fh-regensburg.de>
List: tech-pkg
Date: 01/13/1999 21:49:54
On Wed, 13 Jan 1999, Christoph Badura wrote:
> >> >% pkg_info -Fe /usr/X11R6/bin/pload
> >> >	=> Shows you which package the named file belongs to
> >> 
> >> >% pkg_info -F /usr/X11R6/bin/pload
> >> >	=> Get mode information on the package the named file belongs to
> >> 
> >> It would appear more normal to me if the default were to tell me what
> >> package a file belongs to.  Everything else can be worked out from that
> >> information.
> 
> >You mean without the -F switch?
> 
> No, I mean with just the "-F" switch.

So "pkg_info -F" lists all files and the pkgs they belong to? 
Incidentally, that's how it work - i just didn't include it in the
examples, sorry:

miyu# ./pkg_info -F
/emul/linux/.linux_lib-version                     linux_lib-2.4
/emul/linux/bin/bash                               linux_lib-2.4
/emul/linux/bin/sh                                 linux_lib-2.4
/emul/linux/etc/host.conf                          linux_lib-2.4
...


> >> Hmm, is the "file name" argument a regex to match in the pkgdb or will
> >> I lose that functionality?  If it were a regex "pkg_info -F" could be
> >> subsumed under "pkg_info -F .*".
> 
> >Nope - dbopen() doesn't seem to provide such matching, or at least I don't
> >know enough about it to do that. Maybe if you construct the right
> >compare-function, this could be possible. 
> 
> This is less useful then "egrep filename /var/db/pkg/*/+CONTENTS"?

it's probably not for two reasons:
1. +CONTENTS doesn't store full pathnames
2. accessing the db-file is much faster than expanding the * and then
   grep through all these files:

miyu# time grep etc/revision-history /var/db/pkg/*/+CONTENTS
/var/db/pkg/linux_lib-2.4/+CONTENTS:etc/revision-history
0.014u 0.225s 0:08.58 2.6%      0+0k 462+69io 13pf+0w
miyu# time ./pkg_info -Fe /emul/linux/etc/revision-history
linux_lib-2.4
0.015u 0.000s 0:00.01 100.0%    0+0k 0+0io 0pf+0w

That's um... factor 800?


> >> I would also prefer it if making a simple error wouldn't dump the whole pkgdb
> >> at me but gave a helpful message instead
> 
> >Simple error like what?
> 
> Like forgetting to add the file name.

That's how things work without the pkgdb, why should they suddenly change
just because the -F switch is given? I don't see any real reason here.


 - Hubert

-- 
Hubert Feyrer <hubert.feyrer@rz.uni-regensburg.de>