[dpdk-dev] [PATCH] devtools: warn about release notes updates

Thomas Monjalon thomas at monjalon.net
Thu May 20 11:47:23 CEST 2021


20/05/2021 09:58, David Marchand:
> Touching release notes should only be for the current version.
> 
> Signed-off-by: David Marchand <david.marchand at redhat.com>
> ---
> -VALIDATE_NEW_API=$(dirname $(readlink -f $0))/check-symbol-change.sh
> +ROOTDIR=$(readlink -f $(dirname $(readlink -f $0))/..)
> +VALIDATE_NEW_API=$ROOTDIR/devtools/check-symbol-change.sh
> +FORBIDDEN_TOKENS_SCRIPT=$ROOTDIR/devtools/check-forbidden-tokens.awk

This change is an unrelated cleanup.
Do we keep it in this patch? I'm fine with it, just asking for clarification.

>  # Enable codespell by default. This can be overwritten from a config file.
>  # Codespell can also be enabled by setting DPDK_CHECKPATCH_CODESPELL to a valid path
> @@ -58,7 +60,7 @@ check_forbidden_additions() { # <patch>
>  		-v EXPRESSIONS="rte_panic\\\( rte_exit\\\(" \
>  		-v RET_ON_FAIL=1 \
>  		-v MESSAGE='Using rte_panic/rte_exit' \
> -		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
> +		-f $FORBIDDEN_TOKENS_SCRIPT \
[...]
> +check_release_notes() { # <patch>
> +	rel_notes_prefix=doc/guides/rel_notes/release_
> +	current_version=$(cat $ROOTDIR/VERSION)
> +	major_version=${current_version%%.*}
> +	current_version=${current_version##${major_version}.}
> +	minor_version=${current_version%%.*}

A simpler version:
cat VERSION | IFS=. read major minor release

> +	current_rn=${rel_notes_prefix}${major_version}_${minor_version}.rst
> +
> +	! grep -e '^--- a/'$rel_notes_prefix -e '^+++ b/'$rel_notes_prefix $1 |

Only the +++ part should matters.

> +		grep -v $current_rn
> +}
[...]
> +	! $verbose || printf '\nChecking release notes updates:\n'
> +	report=$(check_release_notes "$tmpinput")
> +	if [ $? -ne 0 ] ; then
> +		$headline_printed || print_headline "$3"
> +		printf '%s\n' "$report"
> +		ret=1
> +	fi

Thanks for adding a new check. More is better :)




More information about the dev mailing list