Subject: CVS commit: pkgsrc
To: None <source-changes@netbsd.org>
From: Hubert Feyrer <hubertf@netbsd.org>
List: source-changes
Date: 03/09/2000 06:05:28
Module Name:	pkgsrc
Committed By:	hubertf
Date:		Thu Mar  9 14:05:28 UTC 2000

Modified Files:
	pkgsrc/mk: bsd.pkg.mk

Log Message:
Change print-depends to look into /var/db/pkg, instead of pkgsrc
(implements $PACKAGE_DEPENDS_QUICK)

--

Thomas Klausner hinted me at some interresting problem WRT the
print-depends package. If something depends on suse_linus-6.*, that
package will register whatever suse_linux there is right now on the system
(in his case V6.1). What print-depends then does is also dig out any pkgs
required for suse_linux, based on what's in pkgsrc, which is of course
_wrong_, as this most likely doesn't match the installed version.[*] The
right thing instead is to print whatever the (currently installed)
suse_linux package depends on, which can be read from "pkg_info -qf"
output, looking at the @pkgdep lines.

Of course this only works if the pkg is actually installed, so it cannot
be used for README.html generation etc., but that's bad luck.

One positive aspect of using the @pkgdep list instead of going down
recursively is that this saves some time and processes. On my P133 it's
going down from ~11s to 0.5s for the pkgsrc/x11/kde package. During a
"make package" of kde itself (not counting the depending pkgs) this will
cut down like 20s (once for the fake-pkg target, and another one for the
pkg_create args - maybe a 3rd time for pkg_create in fake-pkg, but I don't
want to check that right now).

Anyways, a general solution would be to use the "pkg_info -qf | grep
@pkgdep" in print-depends instead of recursion (only!) in the places that
we know that the depends are installed. Which is the PKG_ARGS assignment
(for pkg_create) and the fake-pkg target.

[*] Plus it may be questioned that we should not go down recursively
    for pkg depends anyways, but this is used in too many subtle ways
    throughout the system to change.


To generate a diff of this commit:
cvs rdiff -r1.413 -r1.414 pkgsrc/mk/bsd.pkg.mk

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.