[dpdk-dev,2/3] scripts: move two identical config fixups into a function

Message ID e78cc50cd33b64d8d6fcc4b7f8be45189ce4f558.1443079633.git.pmatilai@redhat.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Panu Matilainen Sept. 24, 2015, 7:34 a.m. UTC
  Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
---
 scripts/validate-abi.sh | 25 ++++++++++++-------------
 1 file changed, 12 insertions(+), 13 deletions(-)
  

Comments

Panu Matilainen Sept. 24, 2015, 7:42 a.m. UTC | #1
On 09/24/2015 10:34 AM, Panu Matilainen wrote:

>   # Checking abi compliance relies on using the dwarf information in
>   # The shared objects.  Thats only included in the DSO's if we build
> @@ -167,6 +171,8 @@ sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
>   export EXTRA_CFLAGS="$EXTRA_CFLAGS -g"
>   export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -g"
>
> +fixup_config
> +
>   # Now configure the build
>   log "INFO" "Configuring DPDK $TAG1"
>   make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
> @@ -196,13 +202,6 @@ git reset --hard
>   log "INFO" "Checking out version $TAG2 of the dpdk"
>   git checkout $TAG2
>
> -# Make sure we configure SHARED libraries
> -# Also turn off IGB and KNI as those require kernel headers to build
> -sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
> -sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
> -sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
> -sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
> -

Doh. Obvious brain damage here, will send v2 after fetching apparently 
needed additional coffee.

	- Panu -
  

Patch

diff --git a/scripts/validate-abi.sh b/scripts/validate-abi.sh
index b9c9989..4b555de 100755
--- a/scripts/validate-abi.sh
+++ b/scripts/validate-abi.sh
@@ -81,6 +81,15 @@  cleanup_and_exit() {
 	exit $1
 }
 
+# Make sure we configure SHARED libraries
+# Also turn off IGB and KNI as those require kernel headers to build
+fixup_config() {
+	sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
+	sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
+	sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
+	sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+}
+
 ###########################################
 #START
 ############################################
@@ -154,12 +163,7 @@  log "INFO" "Checking out version $TAG1 of the dpdk"
 # Move to the old version of the tree
 git checkout $TAG1
 
-# Make sure we configure SHARED libraries
-# Also turn off IGB and KNI as those require kernel headers to build
-sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
+fixup_config
 
 # Checking abi compliance relies on using the dwarf information in
 # The shared objects.  Thats only included in the DSO's if we build
@@ -167,6 +171,8 @@  sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
 export EXTRA_CFLAGS="$EXTRA_CFLAGS -g"
 export EXTRA_LDFLAGS="$EXTRA_LDFLAGS -g"
 
+fixup_config
+
 # Now configure the build
 log "INFO" "Configuring DPDK $TAG1"
 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1
@@ -196,13 +202,6 @@  git reset --hard
 log "INFO" "Checking out version $TAG2 of the dpdk"
 git checkout $TAG2
 
-# Make sure we configure SHARED libraries
-# Also turn off IGB and KNI as those require kernel headers to build
-sed -i -e"$ a\CONFIG_RTE_BUILD_SHARED_LIB=y" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_NEXT_ABI=n" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_EAL_IGB_UIO=n" config/defconfig_$TARGET
-sed -i -e"$ a\CONFIG_RTE_LIBRTE_KNI=n" config/defconfig_$TARGET
-
 # Now configure the build
 log "INFO" "Configuring DPDK $TAG2"
 make config T=$TARGET O=$TARGET > $VERBOSE 2>&1