Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Oct 2025 10:30:23 GMT
From:      Gleb Popov <arrowd@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: c00c521f6f2f - main - Mk/bsd.port.mk: Allow DIST_SUBDIR to be defined, but empty
Message-ID:  <202510261030.59QAUNPW079590@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=c00c521f6f2f02e046921f5cfbd0e271f0baeab7

commit c00c521f6f2f02e046921f5cfbd0e271f0baeab7
Author:     Gleb Popov <arrowd@FreeBSD.org>
AuthorDate: 2025-10-09 18:38:10 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2025-10-26 10:29:38 +0000

    Mk/bsd.port.mk: Allow DIST_SUBDIR to be defined, but empty
    
    The rationale for this change is to allow ports to cancel out
    DIST_SUBDIR that is set by some USES. For example, `Uses/linux.mk` has
    `DIST_SUBDIR?= rocky` and we want to be able to opt-out of this in the port.
    
    Approved by: bapt (portmgr)
    Differential Revision: https://reviews.freebsd.org/D53028
---
 Mk/bsd.port.mk | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index cf5e79d53f37..ad654761fcfb 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -113,7 +113,7 @@ FreeBSD_MAINTAINER=	portmgr@FreeBSD.org
 #				  Default: not set.
 # PATCH_SITES	- Primary location(s) for distribution patch files
 #				  if not found locally.
-# DIST_SUBDIR	- Suffix to ${DISTDIR}.  If set, all ${DISTFILES} and
+# DIST_SUBDIR	- Suffix to ${DISTDIR}.  If set to non-empty value, all ${DISTFILES} and
 #				  ${PATCHFILES} will be put in this subdirectory of
 #				  ${DISTDIR} (see below).  Also they will be fetched in this
 #				  subdirectory from FreeBSD mirror sites.
@@ -1007,7 +1007,7 @@ PORTSDIR?=		/usr/ports
 LOCALBASE?=		/usr/local
 LINUXBASE?=		/compat/linux
 DISTDIR?=		${PORTSDIR}/distfiles
-_DISTDIR?=		${DISTDIR}${DIST_SUBDIR:D/${DIST_SUBDIR}}
+_DISTDIR?=		${DISTDIR}${empty(DIST_SUBDIR):?:${DIST_SUBDIR:D/${DIST_SUBDIR}}}
 INDEXDIR?=		${PORTSDIR}
 SRC_BASE?=		/usr/src
 USESDIR?=		${PORTSDIR}/Mk/Uses
@@ -2544,7 +2544,7 @@ _PATCH_SITES_ENV+=	_PATCH_SITES_${_group}=${_PATCH_SITES_${_group}:Q}
 CKSUMFILES=		${ALLFILES}
 
 # List of all files, with ${DIST_SUBDIR} in front.  Used for checksum.
-.    if defined(DIST_SUBDIR)
+.    if defined(DIST_SUBDIR) && !empty(DIST_SUBDIR)
 .      if defined(CKSUMFILES) && ${CKSUMFILES}!=""
 _CKSUMFILES?=	${CKSUMFILES:S/^/${DIST_SUBDIR}\//}
 .      endif
@@ -3910,7 +3910,7 @@ delete-distfiles:
 			fi; \
 		done; \
 	fi)
-.      if defined(DIST_SUBDIR)
+.      if defined(DIST_SUBDIR) && !empty(DIST_SUBDIR)
 	-@${RMDIR} ${_DISTDIR} >/dev/null 2>&1 || ${TRUE}
 .      endif
 .    endif
@@ -3927,7 +3927,7 @@ delete-distfiles-list:
 			fi; \
 		done; \
 	fi
-.      if defined(DIST_SUBDIR)
+.      if defined(DIST_SUBDIR) && !empty(DIST_SUBDIR)
 	@${ECHO_CMD} "${RMDIR} ${_DISTDIR} 2>/dev/null || ${TRUE}"
 .      endif
 .    endif


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510261030.59QAUNPW079590>