git: 20f33287b059 - main - Mk/bsd.port.mk: Drop the strip parameter from PATCHFILES passed to do-fetch.sh

From: Mateusz Piotrowski <0mp_at_FreeBSD.org>
Date: Fri, 18 Sep 2026 12:08:34 UTC
The branch main has been updated by 0mp:

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

commit 20f33287b0595c202d793ae03b555e18bca17ffe
Author:     Mateusz Piotrowski <0mp@FreeBSD.org>
AuthorDate: 2026-09-18 11:27:13 +0000
Commit:     Mateusz Piotrowski <0mp@FreeBSD.org>
CommitDate: 2026-09-18 12:07:44 +0000

    Mk/bsd.port.mk: Drop the strip parameter from PATCHFILES passed to do-fetch.sh
    
    After recent changes to handling of do-fetch.sh in bsd.port.mk, the
    strip parameters (e.g., ":-p1") are no longer dropped before do-fetch.sh
    receives patch files.
    
    As a result, a strip parameter of a patch file might be interpreted as a
    group instead and get prepended to the patch file, resulting in warnings
    like:
    
    ```
    $ make makesum
    ===>  License MIT accepted by the user
    => e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch doesn't seem to exist in /var/cache/distfiles.
    => Attempting to fetch p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch
    fetch: p1e3efbb5923f638b38087a3f616906d9d4fdaf6f2.patch: No such file or directory
    ```
    
    Reviewed by:    mat
    Approved by:    portmgr (mat)
    Fixes:          076687302bff Mk: fix checksum/fetch/makesum with large distfiles set
    Sponsored by:   fme AG
    Differential Revision:  https://reviews.freebsd.org/D59811
---
 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 e43c07487f4e..fcbf8127a93f 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -3144,7 +3144,7 @@ ${_target}:
 	@printf '%s\n' "${site}" >> ${_PATCH_SITES_FILE}
 .          endfor
 .          for file in ${PATCHFILES}
-	@printf '%s\n' "${file}" >> ${_PATCHFILES_FILE}
+	@printf '%s\n' "${file:C/:p[0-9]//}" >> ${_PATCHFILES_FILE}
 .          endfor
 	@${SETENV} \
 			${_DO_FETCH_ENV} \