Currently the ports infrastructure normalizes PKGPATH with repect to CURDIR, however I've noticed that this does not work properly if you set PORTSDIR_PATH to point to some "mystuff" directory outside the normal ports tree.
For example: $ pwd /PKGROOT/ACTIVE/mystuff/audio/audacity $ pwd -P /data1/obsd-pkg/3.8/mystuff/audio/audacity $ $ make show=PORTSDIR /PKGROOT/ACTIVE/ports $ make show=PORTSDIR_PATH /PKGROOT/ACTIVE/mystuff:/PKGROOT/ACTIVE/ports $ $ make all-dir-depends /data1/obsd-pkg/3.8/mystuff/audio/audacity x11/wxWidgets/gtk x11/wxWidgets/gtk x11/gtk+ x11/gtk+ devel/glib x11/gtk+ converters/libiconv converters/libiconv devel/metaauto converters/libiconv devel/autoconf/2.57 devel/autoconf/2.57 devel/help2man x11/gtk+ devel/gettext devel/gettext converters/libiconv devel/gettext converters/libiconv x11/gtk+ devel/gettext x11/gtk+ devel/gettext x11/wxWidgets/gtk graphics/jpeg x11/wxWidgets/gtk graphics/png x11/wxWidgets/gtk graphics/tiff graphics/tiff graphics/jpeg graphics/tiff devel/libtool devel/libtool devel/metaauto devel/libtool devel/autoconf/2.59 devel/autoconf/2.59 devel/help2man x11/wxWidgets/gtk converters/libiconv x11/wxWidgets/gtk devel/gmake devel/gmake converters/libiconv devel/gmake devel/gettext devel/gmake devel/gettext devel/gmake devel/gettext x11/wxWidgets/gtk x11/wxWidgets/headers x11/wxWidgets/headers graphics/jpeg x11/wxWidgets/headers graphics/png x11/wxWidgets/headers graphics/tiff x11/wxWidgets/headers converters/libiconv x11/wxWidgets/headers devel/gmake x11/wxWidgets/headers converters/libiconv x11/wxWidgets/gtk converters/libiconv /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/libsndfile /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/libsamplerate audio/libsamplerate audio/libsndfile audio/libsamplerate devel/pkgconfig audio/libsamplerate devel/libtool /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/flac audio/flac audio/libogg audio/flac converters/libiconv audio/flac devel/nasm audio/flac converters/libiconv /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/libvorbis audio/libvorbis audio/libogg /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/libid3tag /data1/obsd-pkg/3.8/mystuff/audio/audacity audio/libmad /data1/obsd-pkg/3.8/mystuff/audio/audacity archivers/zip archivers/zip archivers/unzip /data1/obsd-pkg/3.8/mystuff/audio/audacity devel/gmake /data1/obsd-pkg/3.8/mystuff/audio/audacity devel/libtool $ This patch fixes this by normalizing against all (physical) paths found in PORTSDIR_PATH, thus "/data1/obsd-pkg/3.8/mystuff/audio/audacity" (in example above) becomes "audio/audacity". Ok? -Brad Ely Index: pkgpath.mk =================================================================== RCS file: /CVSROOT/ports/infrastructure/mk/pkgpath.mk,v retrieving revision 1.4 diff -u -r1.4 pkgpath.mk --- pkgpath.mk 28 Aug 2003 21:50:12 -0000 1.4 +++ pkgpath.mk 10 Sep 2005 07:53:15 -0000 @@ -4,18 +4,24 @@ # definitions common to bsd.port.mk and bsd.port.subdir.mk +PORTSDIR_PATH?=${PORTSDIR}:${PORTSDIR}/mystuff + .if !defined(PKGPATH) -_PORTSDIR!= cd ${PORTSDIR} && pwd -P -_CURDIR!= cd ${.CURDIR} && pwd -P +_CURDIR!=cd ${.CURDIR} && pwd -P +_PORTSDIR_PATH!=for i in ${PORTSDIR_PATH:S,:, ,}; do cd $$i; pwd -P; done +. for _i in ${_PORTSDIR_PATH} +. if ${_CURDIR:M${_i}/*} +_PORTSDIR=${_i} +. endif +. endfor PKGPATH=${_CURDIR:S,${_PORTSDIR}/,,} .endif + .if empty(PKGPATH) PKGDEPTH= .else PKGDEPTH=${PKGPATH:C|[^./][^/]*|..|g}/ .endif - -PORTSDIR_PATH?=${PORTSDIR}:${PORTSDIR}/mystuff # Code to invoke to split dir,-multi,flavor