patches for DPDK stable branches
 help / color / mirror / Atom feed
From: luca.boccassi@gmail.com
To: stable@dpdk.org
Cc: Luca Boccassi <luca.boccassi@microsoft.com>
Subject: [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file
Date: Mon, 22 Feb 2021 15:01:14 +0000	[thread overview]
Message-ID: <20210222150115.278569-1-luca.boccassi@gmail.com> (raw)

From: Luca Boccassi <luca.boccassi@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(-)

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


             reply	other threads:[~2021-02-22 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-22 15:01 luca.boccassi [this message]
2021-02-22 15:01 ` [dpdk-stable] [scripts 2/2] 4-final-review: silence git/pushd/popd commands luca.boccassi
2021-02-22 15:13   ` Christian Ehrhardt
2021-02-22 15:12 ` [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file Christian Ehrhardt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210222150115.278569-1-luca.boccassi@gmail.com \
    --to=luca.boccassi@gmail.com \
    --cc=luca.boccassi@microsoft.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).