Subject: old pkgsrc installation on Linux broken by old bmake and Makefile syntax
To: None <>
From: Klaus Heinz <>
List: tech-pkg
Date: 12/24/2006 04:00:46

I wanted to update pkgsrc on a Linux machine where I had not touched the
pkgsrc tree for about  a year:
  -r-xr-xr-x  1 root root 117400 Jul 10  2005 /opt/pkg/bin/bmake

After updating the pkgsrc tree I was told:

 $ cd devel/libidn
 $ bmake fetch
 WARNING: [] Unknown object format for installed package digest-20050323
 => Required installed package digest>=20010302: digest-20050323 found
 ===> Skipping vulnerability checks.
 WARNING: No /opt/pkgdistfiles/pkg-vulnerabilities file found.
 WARNING: To fix, install the pkgsrc/security/audit-packages
 WARNING: package and run: ``/opt/pkg/sbin/download-vulnerability-list''.

Nothing more. No file fetched.

My investigation turned out the fact that in mk/fetch/ the line

  do-fetch-file: .USE

does not work. If I remove ".USE" the old bmake tries to fetch file
"do-fetch-file". I _think_ the installed version of bmake is
bmake-20050530 (the current bmake at the time, July 2005) and the man
page already mentions .USE but it does not work for me as intended.
On the other hand "ident bmake" tells me
  $NetBSD: main.c,v 1.2 2005/01/05 21:54:40 tv Exp $

Does anyone know when .USE was introduced?

Anyway, it seems to me that pkgsrc needs a version check for bmake the
same way it checks for the latest pkg_* tools and for digest.

I could not find a way to ask bmake for its own version, neither with a
command line switch nor an internal variable.
We could work around this if the bootstrap process registered bmake as a
package with a version number but as far as I know this does not happen
at the moment.

Whether it is easier to add an internal variable (and command line
option) to bmake or to change the bootstrap process I do not know,
but I prefer the first solution. Asking bmake for its version looks
better to me.