pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/38272: PKG_TOOLS_BIN may need reevaluation after installation of pkg_install

>Number:         38272
>Category:       pkg
>Synopsis:       PKG_TOOLS_BIN may need reevaluation after installation of 
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Mar 21 20:50:00 +0000 2008
>Originator:     Gavan Fantom
>Release:        NetBSD 4.0_BETA2
Nowadays, pkg_install is pulled in as a bootstrap dependency instead of forcing 
a build failure.

Unfortunately, if the upgrade of pkg_install is from a version which was 
previously installed in /usr/sbin, pkgsrc will continue to use package tools 
from /usr/sbin until the next invocation of make.

This stems from the fact that PKG_TOOLS_BIN is set in platform/ like 

.if exists(${LOCALBASE}/sbin/pkg_info)
PKG_TOOLS_BIN?=         ${LOCALBASE}/sbin
PKG_TOOLS_BIN?=         /usr/sbin

At the time that platform/ is parsed, there is no 
${LOCALBASE}/sbin/pkg_info, so PKG_TOOLS_BIN is correctly set to /usr/sbin.

However, the change to making the update of pkg_install into a dependency 
rather than a separate incovation of make means that PKG_TOOLS_BIN will stay as 
/usr/sbin for the rest of the current invocation of make.

This will only affect NetBSD, since at present all other platforms define 
PKG_TOOLS_BIN to always be ${LOCALBASE}/sbin.

While I have been testing this using pkg_comp so that I don't have to trash the 
tools on a machine I care about, I believe this will equally apply with vanilla 
Install NetBSD (a version with pkg_info which doesn't understand -E)
Install pkgsrc
Build a package
Watch as pkg_install is installed as a dependency, but the build subsequently 
fails because it thinks that pkg_install isn't installed due to it using the 
old pkg_info which doesn't understand -E.
Build the same package again
Watch as the package successfully builds

Of course, pkg_comp makes this easier.

Ensure that PKG_TOOLS_BIN gets reevaluated appropriately.
I can't think of a way of doing this within BSD make (although my make foo has 
got a little rusty of late). Perhaps we need a framework for continuing 
execution within a new make process.

Home | Main Index | Thread Index | Old Index