Framework: load firmware repo scripts on post update

The procedure can be risky if dependent on the availability of
binaries not directly depended on by the plugin, but that's not
a problem of the plugin code providing this feature.

While here use LOCALBASE where possible.
This commit is contained in:
Franco Fichtner
2024-01-17 08:46:53 +01:00
parent 48cf401fa6
commit c888c851d7
+10 -4
View File
@@ -133,8 +133,8 @@ manifest: check
done
@echo "}"
.endif
@if [ -f ${WRKSRC}/usr/local/opnsense/version/${PLUGIN_NAME} ]; then \
echo "annotations $$(cat ${WRKSRC}/usr/local/opnsense/version/${PLUGIN_NAME})"; \
@if [ -f ${WRKSRC}${LOCALBASE}/opnsense/version/${PLUGIN_NAME} ]; then \
echo "annotations $$(cat ${WRKSRC}${LOCALBASE}/opnsense/version/${PLUGIN_NAME})"; \
fi
scripts: check scripts-pre scripts-auto scripts-manual scripts-post
@@ -187,6 +187,12 @@ scripts-auto:
${DESTDIR}/+POST_INSTALL; \
done; \
fi
@if [ -d ${.CURDIR}/src/opnsense/scripts/firmware/repos ]; then \
for FILE in $$(cd ${.CURDIR} && find -s \
src/opnsense/scripts/firmware/repos -type f); do \
echo "${LOCALBASE}/$${FILE#.}" >> ${DESTDIR}/+POST_INSTALL; \
done \
fi
scripts-manual:
@for SCRIPT in ${PLUGIN_SCRIPTS}; do \
@@ -275,7 +281,7 @@ package: check
@${MAKE} DESTDIR=${WRKSRC} install
@echo " done"
@echo ">>> Generated version info for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}:"
@cat ${WRKSRC}/usr/local/opnsense/version/${PLUGIN_NAME}
@cat ${WRKSRC}${LOCALBASE}/opnsense/version/${PLUGIN_NAME}
@echo -n ">>> Generating metadata for ${PLUGIN_PKGNAME}-${PLUGIN_PKGVERSION}..."
@${MAKE} DESTDIR=${WRKSRC} metadata
@echo " done"
@@ -436,7 +442,7 @@ style-model:
test: check
@if [ -d ${.CURDIR}/src/opnsense/mvc/tests ]; then \
cd /usr/local/opnsense/mvc/tests && \
cd ${LOCALBASE}/opnsense/mvc/tests && \
phpunit --configuration PHPunit.xml \
${.CURDIR}/src/opnsense/mvc/tests; \
fi