patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file
@ 2021-02-22 15:01 luca.boccassi
  2021-02-22 15:01 ` [dpdk-stable] [scripts 2/2] 4-final-review: silence git/pushd/popd commands luca.boccassi
  2021-02-22 15:12 ` [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file Christian Ehrhardt
  0 siblings, 2 replies; 4+ messages in thread
From: luca.boccassi @ 2021-02-22 15:01 UTC (permalink / raw)
  To: stable; +Cc: Luca Boccassi

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-02-22 15:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 15:01 [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file luca.boccassi
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

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).