mirror of
https://github.com/netbirdio/plugins.git
synced 2026-05-22 18:44:07 -07:00
Framework: hooray, the `upgrade' target is here \o/
Repair a bit of my previous code splatter while here.
This commit is contained in:
@@ -15,6 +15,7 @@ list:
|
||||
@echo ${PLUGIN_DIR} -- $$(${MAKE} -C ${PLUGIN_DIR} -V PLUGIN_COMMENT)
|
||||
.endfor
|
||||
|
||||
# shared targets that are sane to run from the root directory
|
||||
TARGETS= lint sweep style style-fix clean
|
||||
|
||||
.for TARGET in ${TARGETS}
|
||||
|
||||
+14
-3
@@ -129,8 +129,8 @@ scripts-auto:
|
||||
done; \
|
||||
fi
|
||||
@if [ -d ${.CURDIR}/src/opnsense/mvc/app/models ]; then \
|
||||
for FILE in $$(cd ${.CURDIR}/src/opnsense/service/templates && \
|
||||
find -s . -mindepth 2 -type d); do \
|
||||
for FILE in $$(cd ${.CURDIR}/src/opnsense/mvc/app/models && \
|
||||
find -s . -depth 2 -type d); do \
|
||||
cat ${TEMPLATESDIR}/models | \
|
||||
sed "s:%%ARG%%:$${FILE#./}:g" >> \
|
||||
${DESTDIR}/+POST_INSTALL; \
|
||||
@@ -138,7 +138,7 @@ scripts-auto:
|
||||
fi
|
||||
@if [ -d ${.CURDIR}/src/opnsense/service/templates ]; then \
|
||||
for FILE in $$(cd ${.CURDIR}/src/opnsense/service/templates && \
|
||||
find -s . -mindepth 2 -type d); do \
|
||||
find -s . -depth 2 -type d); do \
|
||||
cat ${TEMPLATESDIR}/templates | \
|
||||
sed "s:%%ARG%%:$${FILE#./}:g" >> \
|
||||
${DESTDIR}/+POST_INSTALL; \
|
||||
@@ -216,6 +216,17 @@ package: check
|
||||
@${PKG} create -v -m ${WRKSRC} -r ${WRKSRC} \
|
||||
-p ${WRKSRC}/plist -o ${PKGDIR}
|
||||
|
||||
upgrade-check: check
|
||||
@if ! ${PKG} info ${PLUGIN_PKGNAME} > /dev/null; then \
|
||||
echo ">>> Cannot find package. Please run 'pkg install ${PLUGIN_PKGNAME}'" >&2; \
|
||||
exit 1; \
|
||||
fi
|
||||
@rm -rf ${PKGDIR}
|
||||
|
||||
upgrade: upgrade-check package
|
||||
@${PKG} delete -fy ${PLUGIN_PKGNAME}
|
||||
@${PKG} add ${PKGDIR}/*.txz
|
||||
|
||||
mount: check
|
||||
mount_unionfs ${.CURDIR}/src ${DESTDIR}${LOCALBASE}
|
||||
|
||||
|
||||
@@ -92,6 +92,7 @@ The make targets for any plugin directory:
|
||||
* install: install to target directory
|
||||
* lint: run syntax checks
|
||||
* package: creates a package
|
||||
* upgrade: upgrades existing package
|
||||
* remove: remove known files from target directory
|
||||
* style-fix: apply style fixes
|
||||
* style: run style checks
|
||||
|
||||
Reference in New Issue
Block a user