Subject: Re: Finding non-pkgsrc files with pkg_admin
To: Hubert Feyrer <hubert@feyrer.de>
From: Peter Bex <Peter.Bex@student.kun.nl>
List: tech-pkg
Date: 04/18/2005 10:47:33
--7J16OGEJ/mt06A90
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=
d=20
> 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
>=20
>  	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=
=20
> the pkgdb. Things manipulated via @exec/@unexec are not reflected in the=
=20
> 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.
>=20
> 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=
=20
> 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.

Regards,
Peter
--=20
http://www.student.kun.nl/peter.bex
--
"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

--7J16OGEJ/mt06A90
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (NetBSD)

iD8DBQFCY3QlLg33BXzVMqsRAsEHAKDB2Wv52xIgW/dt242jJ8rWDNT1YACeL8Rd
oDwsmq/zCFb0MbmfcSIXikk=
=0PJE
-----END PGP SIGNATURE-----

--7J16OGEJ/mt06A90--