git: 3fc4fad26362 - main - Mk/bsd.port.mk: Remove confusing double "/" from _DISTDIR

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Sun, 13 Jul 2025 09:32:50 UTC
The branch main has been updated by 0mp:

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

commit 3fc4fad263626857ec9252641e2794df6539d910
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2025-07-13 09:24:20 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2025-07-13 09:32:47 +0000

    Mk/bsd.port.mk: Remove confusing double "/" from _DISTDIR
    
    _DISTDIR is a variable which stores the distfiles directory of the port
    that is currently being worked on. In practice, it is usually just
    the DISTDIR, although some ports also define a subdirectory. Currently,
    a slash separating DISTDIR from DIST_SUBDIR is added to _DISTDIR
    no matter if DIST_SUBDIR is set or not. This may cause confusion to
    ports users by looking like a bug while it is not.
    
    In particular, this patch casuses diagnostic logs of failed archive
    extraction to look like this:
    
        ===>  Failed to extract "/portdistfiles/ttf-iosevka-ss05-4.1.1.zip".
    
    Instead of this:
    
        ===>  Failed to extract "/portdistfiles//ttf-iosevka-ss05-4.1.1.zip".
    
    PR:             282291
    Reviewed by:    pizzamig
    Approved by:    pizzamig (portmgr)
    Event:          Berlin Hackathon 202507
    Differential Revision:  https://reviews.freebsd.org/D27722
---
 Mk/bsd.port.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 4553edb0072c..fb3e0cc839eb 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1007,7 +1007,7 @@ PORTSDIR?=		/usr/ports
 LOCALBASE?=		/usr/local
 LINUXBASE?=		/compat/linux
 DISTDIR?=		${PORTSDIR}/distfiles
-_DISTDIR?=		${DISTDIR}/${DIST_SUBDIR}
+_DISTDIR?=		${DISTDIR}${DIST_SUBDIR:D/${DIST_SUBDIR}}
 INDEXDIR?=		${PORTSDIR}
 SRC_BASE?=		/usr/src
 USESDIR?=		${PORTSDIR}/Mk/Uses