From 52d91d0417c853206eef99836970aa397d750ab4 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Fri, 22 Jul 2022 08:42:09 +0200 Subject: [PATCH] make: remove WANTS/WANT magic The packages use is too explicit so simply check for installed debug plugin and hope for the best. --- Makefile | 22 +++++++++------------- Mk/defaults.mk | 2 ++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index 406dfa521..4dd0df191 100644 --- a/Makefile +++ b/Makefile @@ -201,13 +201,8 @@ WRKSRC?=${WRKDIR}/src PKGDIR?=${WRKDIR}/pkg MFCDIR?=${WRKDIR}/mfc -WANTS= p5-File-Slurp php${CORE_PHP}-pear-PHP_CodeSniffer \ - phpunit7-php${CORE_PHP} py${CORE_PYTHON}-pycodestyle - -.for WANT in ${WANTS} -want-${WANT}: - @${PKG} info ${WANT} > /dev/null -.endfor +debug: + @${VERSIONBIN} ${@} > /dev/null mount: @if [ ! -f ${WRKDIR}/.mount_done ]; then \ @@ -395,10 +390,10 @@ sweep: STYLEDIRS?= src/etc/inc src/opnsense -style-python: want-py${CORE_PYTHON}-pycodestyle +style-python: debug @pycodestyle-${CORE_PYTHON_DOT} --ignore=E501 ${.CURDIR}/src || true -style-php: want-php${CORE_PHP}-pear-PHP_CodeSniffer +style-php: debug @: > ${WRKDIR}/style.out .for STYLEDIR in ${STYLEDIRS} @(phpcs --standard=ruleset.xml ${.CURDIR}/${STYLEDIR} \ @@ -411,14 +406,14 @@ style-php: want-php${CORE_PHP}-pear-PHP_CodeSniffer @cat ${WRKDIR}/style.out | ${PAGER} @rm ${WRKDIR}/style.out -style-fix: want-php${CORE_PHP}-pear-PHP_CodeSniffer +style-fix: debug .for STYLEDIR in ${STYLEDIRS} phpcbf --standard=ruleset.xml ${.CURDIR}/${STYLEDIR} || true .endfor style: style-python style-php -license: want-p5-File-Slurp +license: debug @${.CURDIR}/Scripts/license > ${.CURDIR}/LICENSE sync: license plist-fix @@ -496,13 +491,14 @@ push: migrate: @src/opnsense/mvc/script/run_migrations.php -test: want-phpunit7-php${CORE_PHP} +test: debug @if [ "$$(${VERSIONBIN} -v)" != "${CORE_PKGVERSION}" ]; then \ echo "Installed version does not match, expected ${CORE_PKGVERSION}"; \ exit 1; \ fi @cd ${.CURDIR}/src/opnsense/mvc/tests && \ - phpunit --configuration PHPunit.xml + phpunit --configuration PHPunit.xml || true; \ + rm -f .phpunit.result.cache checkout: @${GIT} reset -q ${.CURDIR}/src && \ diff --git a/Mk/defaults.mk b/Mk/defaults.mk index 701fed049..610e5e302 100644 --- a/Mk/defaults.mk +++ b/Mk/defaults.mk @@ -63,6 +63,8 @@ VERSIONBIN= ${LOCALBASE}/sbin/opnsense-version .if exists(${VERSIONBIN}) _CORE_ABI!= ${VERSIONBIN} -a CORE_ABI?= ${_CORE_ABI} +.else +VERSIONBIN= true .endif PYTHONLINK= ${LOCALBASE}/bin/python3