Commit 019e1c1b authored by Franco Fichtner's avatar Franco Fichtner

make: probe for upgraded package first, show hint on how to fix

parent 35127272
...@@ -239,7 +239,7 @@ package-keywords: force ...@@ -239,7 +239,7 @@ package-keywords: force
fi fi
@echo ">>> Installed /usr/ports/Keywords/sample.ucl" @echo ">>> Installed /usr/ports/Keywords/sample.ucl"
package: force package-check: force
@if [ -f ${WRKDIR}/.mount_done ]; then \ @if [ -f ${WRKDIR}/.mount_done ]; then \
echo ">>> Cannot continue with live mount. Please run 'make umount'." >&2; \ echo ">>> Cannot continue with live mount. Please run 'make umount'." >&2; \
exit 1; \ exit 1; \
...@@ -248,6 +248,8 @@ package: force ...@@ -248,6 +248,8 @@ package: force
echo ">>> Missing required file(s). Please run 'make package-keywords'" >&2; \ echo ">>> Missing required file(s). Please run 'make package-keywords'" >&2; \
exit 1; \ exit 1; \
fi fi
package: package-check
@rm -rf ${WRKSRC} ${PKGDIR} @rm -rf ${WRKSRC} ${PKGDIR}
@${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} metadata @${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} metadata
@${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} install @${MAKE} DESTDIR=${WRKSRC} FLAVOUR=${FLAVOUR} install
...@@ -256,9 +258,15 @@ package: force ...@@ -256,9 +258,15 @@ package: force
@echo -n "Successfully built " @echo -n "Successfully built "
@cd ${PKGDIR}; find . -name "*.txz" | cut -c3- @cd ${PKGDIR}; find . -name "*.txz" | cut -c3-
upgrade: package upgrade-check: force
@if ! ${PKG} info ${CORE_NAME} > /dev/null; then \
echo ">>> Cannot find package. Please run 'opnsense-update -t ${CORE_NAME}'" >&2; \
exit 1; \
fi
upgrade: upgrade-check package
@${PKG} set -yv 0 ${CORE_NAME} @${PKG} set -yv 0 ${CORE_NAME}
${PKG} delete -y ${CORE_NAME} @${PKG} delete -y ${CORE_NAME}
@${PKG} add ${PKGDIR}/*.txz @${PKG} add ${PKGDIR}/*.txz
@${PKG} set -yv 1 ${CORE_NAME} @${PKG} set -yv 1 ${CORE_NAME}
@/usr/local/etc/rc.restart_webgui @/usr/local/etc/rc.restart_webgui
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment