plugins: add double-quotes to fix handling files with spaces (#4187)

This commit is contained in:
TotalGriffLock 2024-08-20 07:26:52 +01:00 committed by GitHub
parent 405fb2e263
commit 8af0c12f9c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -211,7 +211,7 @@ scripts-post:
install: check
@mkdir -p ${DESTDIR}${LOCALBASE}/opnsense/version
@(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \
tar -C ${.CURDIR}/src -cpf - $${FILE} | \
tar -C ${.CURDIR}/src -cpf - "$${FILE}" | \
tar -C ${DESTDIR}${LOCALBASE} -xpf -; \
if [ "$${FILE%%.in}" != "$${FILE}" ]; then \
sed -i '' ${SED_REPLACE} "${DESTDIR}${LOCALBASE}/$${FILE}"; \
@ -253,17 +253,17 @@ metadata: check
collect: check
@(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \
tar -C ${DESTDIR}${LOCALBASE} -cpf - $${FILE} | \
tar -C ${DESTDIR}${LOCALBASE} -cpf - "$${FILE}" | \
tar -C ${.CURDIR}/src -xpf -; \
done
remove: check
@(cd ${.CURDIR}/src 2> /dev/null && find * -type f) | while read FILE; do \
rm -f ${DESTDIR}${LOCALBASE}/$${FILE}; \
rm -f "${DESTDIR}${LOCALBASE}/$${FILE}"; \
done
@(cd ${.CURDIR}/src 2> /dev/null && find * -type d -depth) | while read DIR; do \
if [ -d ${DESTDIR}${LOCALBASE}/$${DIR} ]; then \
rmdir ${DESTDIR}${LOCALBASE}/$${DIR} 2> /dev/null || true; \
if [ -d "${DESTDIR}${LOCALBASE}/$${DIR}" ]; then \
rmdir "${DESTDIR}${LOCALBASE}/$${DIR}" 2> /dev/null || true; \
fi; \
done
@ -324,7 +324,7 @@ lint-shell:
if [ "$$(head $${FILE} | grep -c '^#!\/')" == "0" ]; then \
echo "Missing shebang in $${FILE}"; exit 1; \
fi; \
sh -n $${FILE} || exit 1; \
sh -n "$${FILE}" || exit 1; \
done
lint-xml: