Subject: pkg/31458: mk/ snubs ghostscript-afpl
To: None <,,>
From: None <>
List: pkgsrc-bugs
Date: 10/03/2005 19:49:01
>Number:         31458
>Category:       pkg
>Synopsis:       mk/ snubs ghostscript-afpl
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Oct 03 19:49:00 +0000 2005
>Originator:     Chapman Flack
>Release:        2.0
NetBSD 2.0 NetBSD 2.0 (lundestad) #11: Sat Mar  5 14:01:49 EST 2005  xxx@xxx:/usr/src/sys/arch/i386/compile/lundestad i386
mk/ is included by package makefiles to create a
depends list of suitable ghostscript packages. It currently does
not include ghostscript-afpl in the list. So, for example, the gv
package gets built to require some earlier version of ghostscript
even if ghostscript-afpl-8.51 is installed.

View, for example,
and observe that it would not be satisfied by ghostscript-afpl-8.51.
I suggest reworking the logic of along these lines:

1. Construct a list of all ghostscript pkgsrc dirs that satisfy the
   functionality constraints (x11, nox11, CUPS).

2. For each pkgsrc dir in that list, make package-name to obtain the
   package version it is offering. pkg_admin pmatch that against
   *$GHOSTSCRIPT_REQD (GHOSTSCRIPT_REQD with a leading wildcard) to
   see if the offered version is usable. If not, drop this pkgsrc
   dir from the list. Otherwise, add this pkgname>=$GHOSTSCRIPT_REQD
   to the depends list and, if its real version is the highest yet
   seen, remember its pkgsrc dir as best.

3. Construct the result as {names-versions from step 2}:best pkgsrc dir

The result will include versions >=$GHOSTSCRIPT_REQD of all packages
satisfying the constraints, and the fallback pkgsrc dir if no package
is present will be the one providing the best version that satisfies
the constraints.