From d2abf95cc9162443258c5ebe7c68a8ac15848568 Mon Sep 17 00:00:00 2001 From: Joseph Mingrone Date: Thu, 9 Nov 2017 21:48:58 +0000 Subject: [PATCH] Ensure .CURDIR contains an absolute path without a trailing slash. Problems can occur when PORTSDIR is a symbolic link, or e.g., make -C /usr/ports/ search key='!*' See also: r450002 https://lists.freebsd.org/pipermail/freebsd-current/2017-November/067386.html Submitted by: rum1cro@yandex.ru Reported by: sergey.dyatko@gmail.com Approved by: portmgr (bdrewery) Differential Revision: https://reviews.freebsd.org/D13019 --- Mk/bsd.port.subdir.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk index 2321b62bfd44..8f1d3b3105cc 100644 --- a/Mk/bsd.port.subdir.mk +++ b/Mk/bsd.port.subdir.mk @@ -47,6 +47,11 @@ README= ${TEMPLATES}/README.category MOVEDDIR?= ${PORTSDIR} MOVEDFILE?= MOVED +# Ensure .CURDIR contains an absolute path without a trailing slash. Failed +# builds can occur when PORTSDIR is a symbolic link, or with something like +# make -C /usr/ports/category/port/. +.CURDIR:= ${.CURDIR:tA} + .include "${PORTSDIR}/Mk/bsd.commands.mk" .MAIN: all