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

* [dpdk-stable] [scripts 2/2] 4-final-review: silence git/pushd/popd commands
  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 ` 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
  1 sibling, 1 reply; 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>

Allow to redirect the output to a file for git-send-email
---
 4-final-review | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/4-final-review b/4-final-review
index 0444b1e..4aa4a75 100755
--- a/4-final-review
+++ b/4-final-review
@@ -54,15 +54,15 @@ do_commit()
 {
 	# $GIT doesn't work, so cd
 
-	pushd $DPDK_DIR
-	git commit -a -s -m "version: ${stable_release_rc}"
+	pushd $DPDK_DIR &>/dev/null
+	git commit -a -s -m "version: ${stable_release_rc}" &>/dev/null
 	if [ "x$SIGN_TAG" == "xyes" ]; then
 		TAG_ARG="-s"
 	else
 		TAG_ARG=""
 	fi
 	git tag ${TAG_ARG} v${stable_release_rc} -a -m "dpdk-${stable_release_rc}"
-	popd
+	popd &>/dev/null
 }
 
 get_shortlog()
-- 
2.29.2


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

* Re: [dpdk-stable] [scripts 1/2] 4-final-review: add support for VERSION file
  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:12 ` Christian Ehrhardt
  1 sibling, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2021-02-22 15:12 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dpdk stable, Luca Boccassi

On Mon, Feb 22, 2021 at 4:01 PM <luca.boccassi@gmail.com> wrote:
>
> 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(-)


Acked-by: Christian Ehrhardt <christian.erhrhardt@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

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

* Re: [dpdk-stable] [scripts 2/2] 4-final-review: silence git/pushd/popd commands
  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
  0 siblings, 0 replies; 4+ messages in thread
From: Christian Ehrhardt @ 2021-02-22 15:13 UTC (permalink / raw)
  To: Luca Boccassi; +Cc: dpdk stable, Luca Boccassi

On Mon, Feb 22, 2021 at 4:01 PM <luca.boccassi@gmail.com> wrote:
>
> From: Luca Boccassi <luca.boccassi@microsoft.com>
>
> Allow to redirect the output to a file for git-send-email

Today I was just about to add this as well - thanks!
Acked-by: Christian Ehrhardt <christian.erhrhardt@canonical.com>

> ---
>  4-final-review | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/4-final-review b/4-final-review
> index 0444b1e..4aa4a75 100755
> --- a/4-final-review
> +++ b/4-final-review
> @@ -54,15 +54,15 @@ do_commit()
>  {
>         # $GIT doesn't work, so cd
>
> -       pushd $DPDK_DIR
> -       git commit -a -s -m "version: ${stable_release_rc}"
> +       pushd $DPDK_DIR &>/dev/null
> +       git commit -a -s -m "version: ${stable_release_rc}" &>/dev/null
>         if [ "x$SIGN_TAG" == "xyes" ]; then
>                 TAG_ARG="-s"
>         else
>                 TAG_ARG=""
>         fi
>         git tag ${TAG_ARG} v${stable_release_rc} -a -m "dpdk-${stable_release_rc}"
> -       popd
> +       popd &>/dev/null
>  }
>
>  get_shortlog()
> --
> 2.29.2
>


-- 
Christian Ehrhardt
Staff Engineer, Ubuntu Server
Canonical Ltd

^ 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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ http://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git