Framework: add revision bump helper and fix a typo

This commit is contained in:
Franco Fichtner 2021-02-15 09:52:10 +01:00
parent 82f5492491
commit 4ab914ceaf
3 changed files with 21 additions and 2 deletions

View File

@ -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}:

View File

@ -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

16
Scripts/revbump.sh Executable file
View File

@ -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