Subject: hardcoded prefix path in pkgtools/pkg_install
To: None <>
From: Douwe Kiela <>
List: tech-pkg
Date: 09/27/2003 20:52:04
I was playing around with pkgsrc on FreeBSD today. I ran the bootstrap like

./bootstrap --prefix=/usr/local --pkgdbdir=/var/pkgdb --pkgsrcdir=/usr/pkgsr

I wanted the packages to be installed in /usr/local together with the
FreeBSD packages from /usr/ports, but maintain the pkg db in a different
place. Now I know that this isn't the best setup, but again, I was just
doing it to play around.. The problem is, when I set the prefix to
/usr/local instead of /usr/pkg, pkg_install should use that path instead of
When I went to /usr/pkgsrc/pkgtools/pkg_install and did "bmake install
distclean", it gave me this error:

/usr/pkg/sbin/pkg_admin: not found
/usr/pkg/sbin/pkg_admin: not found
===> Checking for vulnerabilities in pkg_install-20030923
/usr/pkg/sbin/pkg_admin: not found
et cetera

It is fixed now, I did the bootstrapping again, only now
with --prefix=/usr/pkg, and it all worked fine. The problem is however, what
if you really want all packages to be installed in a directory different
from /usr/pkg? How would this be possible if /usr/pkg is hardcoded in the
only package you really need to install other packages from pkgsrc:
pkgtools/pkg_install. Developers stress the fact that no paths should be
hardcoded into packages, but it is hardcoded in pkgtools/pkg_install. Is
there a reason that it is hardcoded, am I overlooking something or doing
something wrong? Because as far as I know it shouldn't be there.