NetBSD Problem Report #54460

From  Tue Aug 13 14:48:02 2019
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id A9C007A1E4
	for <>; Tue, 13 Aug 2019 14:48:02 +0000 (UTC)
Message-Id: <>
Date: Tue, 13 Aug 2019 14:48:01 +0000 (UTC)
Subject: pkg_chk mixes non-default installation with /usr/pkg(src)
X-Send-Pr-Version: www-1.0

>Number:         54460
>Category:       pkg
>Synopsis:       pkg_chk mixes non-default installation with /usr/pkg(src)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    abs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Aug 13 14:50:00 +0000 2019
>Last-Modified:  Tue Aug 13 23:55:38 +0000 2019
>Originator:     Joern Clausen
See this mail thread for context:

When installing pkgsrc with a non-default prefix (LOCALBASE) on NetBSD, and a native pkgsrc installation with /usr/pkg, /usr/pkgsrc and /etc/mk.conf is present, the non-default pkg_chk will find and use configuration and packages from the native installation. It will read both LOCALBASE/pkgchk.conf and /usr/pkgsrc/pkgchk.conf. It will try to install packages from /usr/pkgsrc/packages/All, although they will not work if installed under LOCALBASE.

The problem seems to stem from the fact, that extract_mk_var() does not return correct values for LOCALBASE and PKGSRCDIR. The function returns the empty default values, making pkg_chk use the native installation instead.

A workaround is to define PKGSRCDIR in $prefix/etc/mk.conf (as LOCALBASE already is), and pkg_chk works as intended. Another, eventually better solution would be to bake the proper values into the pkg_chk script, as is already done for several other variables.




Responsible-Changed-From-To: pkg-manager->abs
Responsible-Changed-When: Tue, 13 Aug 2019 23:55:38 +0000
David, can you please give it a look?
(Over to OWNER)


NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 maya Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.