diff --git a/Makefile b/Makefile index 6c21da0d9..82aa061e9 100644 --- a/Makefile +++ b/Makefile @@ -43,7 +43,7 @@ list: .endfor # shared targets that are sane to run from the root directory -TARGETS= clean lint style style-fix style-python sweep test +TARGETS= clean lint revision style style-fix style-python sweep test .for TARGET in ${TARGETS} ${TARGET}: diff --git a/Mk/plugins.mk b/Mk/plugins.mk index ac202ae30..56ff42e2d 100644 --- a/Mk/plugins.mk +++ b/Mk/plugins.mk @@ -325,7 +325,10 @@ sweep: check ! -name "*.ser" -type f -print0 | \ xargs -0 -n1 ${SCRIPTSDIR}/cleanfile find ${.CURDIR} -type f -depth 1 -print0 | \ - xargs -0 -n1 ${SCRIPTSDIRs/cleanfile + xargs -0 -n1 ${SCRIPTSDIR}/cleanfile + +revision: + ${SCRIPTSDIR}/revbump.sh ${.CURDIR} STYLEDIRS?= src/etc/inc src/opnsense diff --git a/Scripts/revbump.sh b/Scripts/revbump.sh new file mode 100755 index 000000000..135168df5 --- /dev/null +++ b/Scripts/revbump.sh @@ -0,0 +1,16 @@ +#!/bin/sh + +set -e + +DIR=${1} + +if [ -z "${DIR}" ]; then + DIR=. +fi + +REV=$(make -C ${DIR} -V PLUGIN_REVISION) +REV=$(expr ${REV} \+ 1) + +grep -v ^PLUGIN_REVISION ${DIR}/Makefile > ${DIR}/Makefile.tmp +sed -e "s/^\(PLUGIN_VERSION.*\)/\1\nPLUGIN_REVISION= ${REV}/g" ${DIR}/Makefile.tmp > ${DIR}/Makefile +rm -f ${DIR}/Makefile.tmp