Subject: Re: Finding non-pkgsrc files with pkg_admin
To: Peter Bex <Peter.Bex@student.kun.nl>
From: Hubert Feyrer <hubert@feyrer.de>
List: tech-pkg
Date: 04/17/2005 21:55:10
On Sun, 17 Apr 2005, Peter Bex wrote:
> I attached the patch in case someone wants to take a look at the code.

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" and 
the see what's not on that list, or add a command line frontend to the 
pkgdb_retrieve() function, so you can do something like

 	find /usr/pkg -type f -print0 | xargs -0 -n1 pkg_admin retrieve

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 
..."), you'll probably find something that creates some files. For another 
example, run this:

 	miyu% pkg_info -qf firefox | grep exec
 	@exec env LD_LIBRARY_PATH=%D/lib/firefox MOZILLA_FIVE_HOME=%D/lib/firefox %D/lib/firefox/regxpcom
 	@exec env LD_LIBRARY_PATH=%D/lib/firefox MOZILLA_FIVE_HOME=%D/lib/firefox %D/lib/firefox/regchrome
 	@exec env LD_LIBRARY_PATH=%D/lib/firefox MOZILLA_FIVE_HOME=%D/lib/firefox %D/lib/firefox/firefox-bin -register
 	@unexec /bin/rm %D/lib/firefox/chrome/chrome.rdf
 	@unexec /bin/rm %D/lib/firefox/chrome/overlayinfo/browser/content/overlays.rdf
 	@unexec /bin/rm %D/lib/firefox/chrome/overlayinfo/communicator/content/overlays.rdf
 	@unexec /bin/rm %D/lib/firefox/chrome/overlayinfo/inspector/content/overlays.rdf
 	@unexec /bin/rm %D/lib/firefox/chrome/overlayinfo/messenger/content/overlays.rdf
 	@unexec /bin/rm %D/lib/firefox/chrome/overlayinfo/navigator/content/overlays.rdf
 	@unexec /bin/rm %D/lib/firefox/components/compreg.dat
 	@unexec /bin/rm %D/lib/firefox/components/xpti.dat

There are some files created at runtime here that aren't put into 
(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.


  - Hubert

-- 
NetBSD - Free AND Open!      (And of course secure, portable, yadda yadda)