[dpdk-dev,pktgen] Fix dpdk-version.sh on Fedora

Message ID 4711b98574eee0efd9e6867c4413b82be98c6167.1501258132.git.tredaelli@redhat.com (mailing list archive)
State Not Applicable, archived
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Timothy Redaelli July 28, 2017, 4:08 p.m. UTC
  Fedora and RHEL dpdk-devel package installs rte_version.h inside
$RTE_INCLUDE (/usr/include/dpdk) instead of $RTE_SDK

Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>
---
 tools/dpdk-version.sh | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)
  

Comments

Wiles, Keith July 28, 2017, 5:32 p.m. UTC | #1
> On Jul 28, 2017, at 11:08 AM, Timothy Redaelli <tredaelli@redhat.com> wrote:

> 

> Fedora and RHEL dpdk-devel package installs rte_version.h inside

> $RTE_INCLUDE (/usr/include/dpdk) instead of $RTE_SDK

> 

> Signed-off-by: Timothy Redaelli <tredaelli@redhat.com>

> ---

> tools/dpdk-version.sh | 16 ++++++++++------

> 1 file changed, 10 insertions(+), 6 deletions(-)

> 

> diff --git a/tools/dpdk-version.sh b/tools/dpdk-version.sh

> index 0989aa4..75146cf 100755

> --- a/tools/dpdk-version.sh

> +++ b/tools/dpdk-version.sh

> @@ -87,15 +87,19 @@ EOM

> 	exit 1

> }

> 

> -if [ -z ${RTE_SDK} ] ; then

> -	echo "*** RTE_SDK is not set, using "${PWD}

> -	sdk=${PWD}

> +if [ -n ${RTE_INCLUDE} ] ; then

> +	fpath=${RTE_INCLUDE}/${fname}

> else

> -	sdk=${RTE_SDK}

> +	if [ -z ${RTE_SDK} ] ; then

> +		echo "*** RTE_SDK is not set, using "${PWD}

> +		sdk=${PWD}

> +	else

> +		sdk=${RTE_SDK}

> +	fi

> +

> +	fpath=${sdk}/lib/librte_eal/common/include/${fname}

> fi

> 

> -fpath=${sdk}/lib/librte_eal/common/include/${fname}


I applied your patch to my ‘dev’ branch. I had added a file path output as well. I did have to patch your patch to work correctly of non-RTE_INCLUDE usage. It appears the [ -n ${RTE_INCLUDE} ] test had to be converted to a -z as the RTE_INCLUDE path was always executed even if RTE_INCLUDE was not defined.

Please give the new version a try and let me know if it works.

> -

> if [ ! -e ${fpath} ]; then

> 	echo "File not found @ "${fpath}

> 	usage

> -- 

> 2.13.3

> 


Regards,
Keith
  

Patch

diff --git a/tools/dpdk-version.sh b/tools/dpdk-version.sh
index 0989aa4..75146cf 100755
--- a/tools/dpdk-version.sh
+++ b/tools/dpdk-version.sh
@@ -87,15 +87,19 @@  EOM
 	exit 1
 }
 
-if [ -z ${RTE_SDK} ] ; then
-	echo "*** RTE_SDK is not set, using "${PWD}
-	sdk=${PWD}
+if [ -n ${RTE_INCLUDE} ] ; then
+	fpath=${RTE_INCLUDE}/${fname}
 else
-	sdk=${RTE_SDK}
+	if [ -z ${RTE_SDK} ] ; then
+		echo "*** RTE_SDK is not set, using "${PWD}
+		sdk=${PWD}
+	else
+		sdk=${RTE_SDK}
+	fi
+
+	fpath=${sdk}/lib/librte_eal/common/include/${fname}
 fi
 
-fpath=${sdk}/lib/librte_eal/common/include/${fname}
-
 if [ ! -e ${fpath} ]; then
 	echo "File not found @ "${fpath}
 	usage