[dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file
Christian Ehrhardt
christian.ehrhardt at canonical.com
Mon Feb 22 16:12:16 CET 2021
On Mon, Feb 22, 2021 at 4:01 PM <luca.boccassi at gmail.com> wrote:
>
> From: Luca Boccassi <luca.boccassi at microsoft.com>
>
> This script was still expecting to find the version
> in the rte_version.h header, but it's now a single file
> in the root of the repo
> ---
> 4-final-review | 28 +++++++++++++++++++++++-----
> 1 file changed, 23 insertions(+), 5 deletions(-)
Acked-by: Christian Ehrhardt <christian.erhrhardt at canonical.com>
>
> diff --git a/4-final-review b/4-final-review
> index c4fedb7..0444b1e 100755
> --- a/4-final-review
> +++ b/4-final-review
> @@ -4,8 +4,26 @@ source ./lib.sh
>
> assert_current_branch
>
> -RTE_VER_RELEASE=$(awk '/#define RTE_VER_RELEASE/ { print $3 }' \
> - $DPDK_DIR/lib/librte_eal/common/include/rte_version.h)
> +if [ -r "$DPDK_DIR/lib/librte_eal/include/rte_version.h" ]; then
> + VERSION_HEADER="$DPDK_DIR/lib/librte_eal/include/rte_version.h"
> +elif [ -r "$DPDK_DIR/lib/librte_eal/common/include/rte_version.h" ]; then
> + VERSION_HEADER="$DPDK_DIR/lib/librte_eal/common/include/rte_version.h"
> +else
> + echo "Cannot find rte_version.h"
> + exit 1
> +fi
> +
> +if [ -e "$DPDK_DIR/VERSION" ]; then
> + if grep -q -F "rc" "$DPDK_DIR/VERSION"; then
> + RTE_VER_RELEASE=$(sed -E "s/.*rc(.*)/\1/" "$DPDK_DIR/VERSION")
> + else
> + RTE_VER_RELEASE=16
> + fi
> +else
> + RTE_VER_RELEASE=$(awk '/#define RTE_VER_RELEASE/ { print $3 }' \
> + ${VERSION_HEADER})
> +fi
> +
> [ $RTE_VER_RELEASE -eq 16 ] && {
> RTE_VER_RELEASE=1
> } || {
> @@ -17,11 +35,11 @@ stable_release_rc="${stable_release}-rc${RTE_VER_RELEASE}"
> change_version()
> {
> sed "s/#define RTE_VER_MINOR [0-9]*/#define RTE_VER_MINOR ${RTE_VER_MINOR}/" \
> - -i $DPDK_DIR/lib/librte_eal/common/include/rte_version.h
> + -i ${VERSION_HEADER}
> sed 's/#define RTE_VER_SUFFIX .*/#define RTE_VER_SUFFIX "-rc"/' \
> - -i $DPDK_DIR/lib/librte_eal/common/include/rte_version.h
> + -i ${VERSION_HEADER}
> sed "s/#define RTE_VER_RELEASE .*/#define RTE_VER_RELEASE ${RTE_VER_RELEASE}/" \
> - -i $DPDK_DIR/lib/librte_eal/common/include/rte_version.h
> + -i ${VERSION_HEADER}
> if [ -e $DPDK_DIR/pkg/dpdk.spec ]; then
> sed "s/Version: .*/Version: ${stable_release_rc}/" -i $DPDK_DIR/pkg/dpdk.spec
> fi
> --
> 2.29.2
>
--
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd
More information about the stable
mailing list