NetBSD Problem Report #48416

From dholland@netbsd.org  Fri Nov 29 23:06:14 2013
Return-Path: <dholland@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 1C795A634A
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 29 Nov 2013 23:06:14 +0000 (UTC)
Message-Id: <20131129230613.A007714A3DF@mail.netbsd.org>
Date: Fri, 29 Nov 2013 23:06:13 +0000 (UTC)
From: dholland@netbsd.org
Reply-To: dholland@netbsd.org
To: gnats-bugs@gnats.NetBSD.org
Subject: pkgtools/pkgin's makefile reads pkgsrc mk.conf
X-Send-Pr-Version: 3.95

>Number:         48416
>Category:       pkg
>Synopsis:       pkgtools/pkgin's makefile reads pkgsrc mk.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    imil
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Nov 29 23:10:00 +0000 2013
>Last-Modified:  Fri Nov 29 23:20:02 +0000 2013
>Originator:     David A. Holland
>Release:        pkgsrc 20131129
>Organization:
>Environment:
n/a
>Description:

pkgin's makefile (the package's own makefile, not the pkgsrc makefile)
contains the following interesting logic:

# satisfy mk.conf
BSD_PKG_MK=     1
.for MK_CONF in /etc/mk.conf @prefix@/etc/mk.conf /etc/pkgsrc.conf
.       if exists(${MK_CONF})
.               include "${MK_CONF}"
.       endif
.endfor

This caused it to fail for me just now because it does this without
setting pkgsrc variables, like PKGPATH, that I was using in the
control logic of a bulk build's mk.conf.

It can also cause problems because a few lines after it does this it
includes <bsd.own.mk>, which also reads mk.conf; and with BSD_PKG_MK
still set, <bsd.own.mk> may get wrong or invalid (or missing)
configuration.

It's also entirely inappropriate from the perspective of how pkgsrc is
constructed and expected to work.

>How-To-Repeat:

Watch it fail to build, inspect why.

>Fix:

Delete this block.

The only catch is, I don't see what it's trying to accomplish by being
there, so this might break something.

>Release-Note:

>Audit-Trail:

Responsible-Changed-From-To: pkg-manager->imil
Responsible-Changed-By: wiz@NetBSD.org
Responsible-Changed-When: Fri, 29 Nov 2013 23:20:02 +0000
Responsible-Changed-Why:
Over to author


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.