Subject: pkg/29187: pkg_chk does not honor pkgdbdir and pkgdir in mk.conf
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <jcoombs@gwi.net>
List: pkgsrc-bugs
Date: 02/01/2005 19:28:00
>Number:         29187
>Category:       pkg
>Synopsis:       pkg_chk does not honor pkgdbdir and pkgdir in mk.conf
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 01 19:28:00 +0000 2005
>Originator:     Joshua Coombs
>Release:        DragonFly BSD
>Organization:
>Environment:
DragonFly network-bd-1.gwi 1.1-Stable DragonFly 1.1-Stable #0: Tue Feb  1 08:12:36 EST 2005     root@network-bd-1.gwi:/usr/obj/usr/src/sys/SANDBOX  i386

>Description:
Using pkgsrc on DragonFly, I chose to use a custom location for the pkgdb, /usr/pkg/var/db/pkgdb

pkg_chk has /var/db/pkgdb hardcoded as the location of the pkgdb.

The offending lines are:
extract_variables()
    {
    extract_mk_dir_var PKGSRCDIR /usr/pkgsrc
    extract_mk_dir_var PKG_DBDIR /var/db/pkg

    # Now we have PKGSRCDIR, use it to determine PACKAGES, and PKGCHK_CONF
    # as well as AWK, GREP, SED, PKGCHK_TAGS and PKGCHK_NOTAGS
    #


>How-To-Repeat:
Install pkgsrc with a custom location for pkgdb

Install packages

Install pkg_chk

run pkg_chk -i, all packages will be listed as having a version mismach like the example output below:
audit-packages-1.32: version mismatch - audit-packages-1.32
libtool-base-1.5.10nb9: version mismatch - libtool-base-1.5.10nb9
libiconv-1.9.2nb1: version mismatch - libiconv-1.9.2nb1
gettext-lib-0.11.5nb4: version mismatch - gettext-lib-0.11.5nb4
gettext-m4-0.11.5: version mismatch - gettext-m4-0.11.5
gettext-0.11.5nb5: version mismatch - gettext-0.11.5nb5

Edit pkg_chk to reflect the correct path, and it will function properly.
>Fix: