Changeset View
Changeset View
Standalone View
Standalone View
head/Mk/Uses/shebangfix.mk
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | |||||
.endfor | .endfor | ||||
_USES_patch+= 210:fix-shebang | _USES_patch+= 210:fix-shebang | ||||
fix-shebang: | fix-shebang: | ||||
.if defined(SHEBANG_REGEX) | .if defined(SHEBANG_REGEX) | ||||
@cd ${WRKSRC}; \ | @cd ${WRKSRC}; \ | ||||
${FIND} -E . -type f -iregex '${SHEBANG_REGEX}' \ | ${FIND} -E . -type f -iregex '${SHEBANG_REGEX}' \ | ||||
-exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + | -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + | ||||
.elif defined(SHEBANG_GLOB) | .endif | ||||
.if defined(SHEBANG_GLOB) | |||||
.for f in ${SHEBANG_GLOB} | . for f in ${SHEBANG_GLOB} | ||||
@cd ${WRKSRC}; \ | @cd ${WRKSRC}; \ | ||||
${FIND} . -type f -name '${f}' \ | ${FIND} . -type f -name '${f}' \ | ||||
-exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + | -exec ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} {} + | ||||
.endfor | . endfor | ||||
.else | .endif | ||||
.if defined(SHEBANG_FILES) | |||||
@cd ${WRKSRC}; \ | @cd ${WRKSRC}; \ | ||||
${ECHO_CMD} ${SHEBANG_FILES} | ${XARGS} ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} | ${ECHO_CMD} ${SHEBANG_FILES} | ${XARGS} ${SED} -i '' ${_SHEBANG_REINPLACE_ARGS} | ||||
.endif | .endif | ||||
.endif | .endif |