Completely orthogonal patch.

Using the same substitution twice is already cause for errors.

Using it 3 times is a sin.

Let's save that somewhere.
Index: dist-tuple.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/dist-tuple.port.mk,v
retrieving revision 1.8
diff -u -p -r1.8 dist-tuple.port.mk
--- dist-tuple.port.mk  4 Sep 2023 15:29:46 -0000       1.8
+++ dist-tuple.port.mk  14 Sep 2023 12:16:00 -0000
@@ -31,17 +31,19 @@ DISTNAME ?= ${_project}-${_id:S/^v//}
 _subdir =      refs/tags/
 .    endif
 
-DISTFILES.${_template} +=      
${TEMPLATE_DISTFILES.${_template}:S/<account>/${_account}/g:S/<project>/${_project}/g:S/<id>/${_id}/g:S/<subdir>/${_subdir}/g}
-.    if !empty(TEMPLATE_HOMEPAGE.${_template})
-HOMEPAGE ?=    
${TEMPLATE_HOMEPAGE.${_template}:S/<account>/${_account}/g:S/<project>/${_project}/g}
-.    endif
+.    for _subst in 
S/<account>/${_account}/g:S/<project>/${_project}/g:S/<id>/${_id}/g:S/<subdir>/${_subdir}/g
+DISTFILES.${_template} +=      ${TEMPLATE_DISTFILES.${_template}:${_subst}}
+.      if !empty(TEMPLATE_HOMEPAGE.${_template})
+HOMEPAGE ?=    ${TEMPLATE_HOMEPAGE.${_template}:${_subst}}
+.      endif
 
-.    if "${_targetdir}" != "."
+.      if "${_targetdir}" != "."
 MODDIST-TUPLE_post-extract += \
        t=${WRKDIST}/${_targetdir}; [[ -d $$t ]] && rmdir $$t \
        || mkdir -p `dirname $$t` ; \
        mv ${WRKDIR}/${_project}-${_id:S/refs\/tags\///:S/^v//} $$t;
-.    endif
+.      endif
 
+.    endfor
 .  endfor
 .endif

Reply via email to