Subject: Re: Finding non-pkgsrc files with pkg_admin
To: Hubert Feyrer <>
From: Peter Bex <>
List: tech-pkg
Date: 04/18/2005 10:47:33
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Sun, Apr 17, 2005 at 09:55:10PM +0200, Hubert Feyrer wrote:
> I'd rather not re-invend find(1) or at least fts(3) in your case.
> The solution I'd probably look into was to either use "pkg_admin dump" an=
> the see what's not on that list, or add a command line frontend to the=20
> pkgdb_retrieve() function, so you can do something like
>  	find /usr/pkg -type f -print0 | xargs -0 -n1 pkg_admin retrieve

Fair enough, that's Unix style.  I should've thought of that :)
Why doesn't pkg_info -L use pkgdb_retrieve, BTW?

> To answer your other question: Only files listed in PLIST are stored in=
> the pkgdb. Things manipulated via @exec/@unexec are not reflected in the=
> pkgdb. If you look at the PLIST of the pkg you listed ("pkg_info -qf=20
> ..."), you'll probably find something that creates some files.
> There are some files created at runtime here that aren't put into=20
> (binary) packages, and that are thus not listed as "normal" files in the=
> PLIST, but get created by some @exec call and removed via @unexec instead.

I understand.  I don't see why @exec files have to be `manually' removed by
@unexec though.  They have to be created dynamically, but they don't have
to be `deleted dynamically', do they?  In the end it's just an RM statement
on a file that was put in place by the pkg system.

Wouldn't it be better to let these @exec statements also generate an entry
in the database and let the removal of the files created by the @exec
statements be handled by the usual deletion system?

That way, pkg_info -L is correct, too.  At least, the manpage for pkg_info
doesn't mention the dynamically generated files at all.  ATM it creates
the impression that it should list all files, which it doesn't exactly.

"The process of preparing programs for a digital computer
 is especially attractive, not only because it can be economically
 and scientifically rewarding, but also because it can be an aesthetic
 experience much like composing poetry or music."
							-- Donald Knuth

Content-Type: application/pgp-signature
Content-Disposition: inline

Version: GnuPG v1.2.4 (NetBSD)