On Mon, Aug 07, 2023 at 10:03:17PM +0200, Marc Espie wrote: > > Doesn't "gen" also run GNU auto* which potentially needs wxallowed? > > That's why I have moved it there now. > > > > Either way, making the check the first step of a target instead needs > > its own target so that PORTS_PRIVSEP=Yes stays in effect. > > > > post-* or *-finalize where the first diff put it do not need that, as > > they're already run as _pbuild. > > > > Does that still work for everyone's favourite USE_WXNEEDED=Yes workflow > > without breaking other stuff, when you forget to set wxallowed? > > If I recall correctly, adding USE_WXNEEDED predates the gen step by some > time, so it might be good there days. >
No further feedback. Unless you mistakenly forget "wxallowed" whilst porting, this diff should not change behaviour in any way. OK? Index: bsd.port.mk =================================================================== RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v retrieving revision 1.1596 diff -u -p -r1.1596 bsd.port.mk --- bsd.port.mk 8 Aug 2023 12:43:53 -0000 1.1596 +++ bsd.port.mk 9 Aug 2023 07:48:54 -0000 @@ -2861,14 +2861,6 @@ ${_PATCH_COOKIE}: ${_EXTRACT_COOKIE} # Run as _pbuild _post-patch-finalize: -.if ${USE_WXNEEDED:L} == "yes" - @wrktmp=`df -P ${WRKOBJDIR_${PKGPATH}} | awk 'END { print $$6 }'`; \ - if ! mount | grep -q " $${wrktmp} .*wxallowed"; then \ - echo "Fatal: ${WRKOBJDIR_${PKGPATH}} must be on a wxallowed filesystem" \ - "(in ${PKGPATH})" >&2; \ - false; \ - fi -.endif .if !empty(_LINKER_FLAGS) || ${_NONDEFAULT_LD:L} == "yes" @printf '#!/bin/sh\nexec ${_LD_PROGRAM} ${_LINKER_FLAGS} "$$@"\n' >${WRKDIR}/bin/ld @chmod 555 ${WRKDIR}/bin/ld @@ -2908,10 +2900,23 @@ _gen-finalize: esac; done .endif +.if ${USE_WXNEEDED:L} == "yes" +_use-wxneeded: + @wrktmp=`df -P ${WRKOBJDIR_${PKGPATH}} | awk 'END { print $$6 }'`; \ + if ! mount | grep -q " $${wrktmp} .*wxallowed"; then \ + echo "Fatal: ${WRKOBJDIR_${PKGPATH}} must be on a wxallowed filesystem" \ + "(in ${PKGPATH})" >&2; \ + false; \ + fi +.endif + # The real gen stage ${_GEN_COOKIE}: ${_PATCH_COOKIE} @${ECHO_MSG} "===> Generating configure for ${FULLPKGNAME}${_MASTER}" +.if ${USE_WXNEEDED:L} == "yes" + @${_PMAKE} _use-wxneeded +.endif .if target(do-gen) @${_PMAKE} do-gen .endif