The following reply was made to PR pkg/45046; it has been noted by GNATS.
From: Thomas Cort <tcort%minix3.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: pkg/45046: mk/* minix support
Date: Sat, 11 Jun 2011 04:48:11 -0400
> =A0> +. =A0elif ${OPSYS} =3D=3D "Minix"
> =A0> +X11BASE?=3D =A0 ${LOCALBASE}/X11R6
>
> =A0Where is it came from?
Minix has it's own X11 package ( minix/x11 ) which installs to
/usr/X11R6. We're currently using x11-6.8.2. Below is a link to that
package in our source repository...
http://git.minix3.org/?p=3Dpkgsrc.git;a=3Dtree;f=3Dminix/x11;h=3Dde0017ccf5=
2cd9361e4550c5f1388ffab3a82f43;hb=3Drefs/heads/minix-master
>
> =A0> +if ${TEST} -n "${PKG_DESTDIR}"; then
> =A0> + =A0 =A0PKG_DBDIR=3D"${PKG_DESTDIR}${PKG_DBDIR}"
> =A0> + =A0 =A0PKG_REFCOUNT_DBDIR=3D"${PKG_DESTDIR}${PKG_REFCOUNT_DBDIR}"
> =A0> + =A0 =A0PKG_REFCOUNT_DIRS_DBDIR=3D"${PKG_DESTDIR}${PKG_REFCOUNT_DIR=
S_DBDIR}"
> =A0> +fi
>
> =A0What is PKG_DESTDIR?
From the author of that code, Gautam B.T.:
PKG_DESTDIR is set by pkg_add and pkg_delete when called with the -P
option. Without these changes packages installed using the -P option
would have a +DIRS script that manipulates the wrong set of
directories.
To explain a little on what's going on: Packages have install and
desintall scripts that are run by pkg_install tools before and after
installation and deletion. Because of this the +DIRS script which is
generated from the mk/pkginstall/dirs file gets executed. Now pkg_add
can be called with -P option to ask it to install stuff in a different
root directory. When this is done pkg_add sets the PKG_DESTDIR
variable. Earlier, the scripts just ignored this variable and these
changes make them honor it.