From 3925b3e9afbee28a49d04752125636fedc970d13 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Wed, 19 Jun 2019 09:26:29 +0200 Subject: travis: Make it possible to build against a dpdk branch. Rework the build script so that we can pass branches and tags. With this, DPDK_VER can be passed as: - a string starting with refs/ which is understood as a git reference. This triggers a git clone on DPDK_GIT (default value points to https://dpdk.org/git/dpdk) for a single branch pointing to this reference (to save some disk), - else, any other string which is understood as an official release. This triggers a tarball download on dpdk.org. Signed-off-by: David Marchand Signed-off-by: Ilya Maximets --- .travis/linux-build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.travis/linux-build.sh b/.travis/linux-build.sh index 3a5c4a2e7..9d84411c5 100755 --- a/.travis/linux-build.sh +++ b/.travis/linux-build.sh @@ -65,16 +65,16 @@ function install_kernel() function install_dpdk() { - if [ -n "$DPDK_GIT" ]; then - git clone $DPDK_GIT dpdk-$1 - cd dpdk-$1 - git checkout tags/v$1 + if [ "${1##refs/*/}" != "${1}" ]; then + DPDK_GIT=${DPDK_GIT:-https://dpdk.org/git/dpdk} + git clone --single-branch $DPDK_GIT dpdk-git -b "${1##refs/*/}" + cd dpdk-git + git log -1 --oneline else wget https://fast.dpdk.org/rel/dpdk-$1.tar.xz tar xvf dpdk-$1.tar.xz > /dev/null DIR_NAME=$(tar -tf dpdk-$1.tar.xz | head -1 | cut -f1 -d"/") - if [ $DIR_NAME != "dpdk-$1" ]; then mv $DIR_NAME dpdk-$1; fi - cd dpdk-$1 + cd $DIR_NAME fi make config CC=gcc T=$TARGET @@ -89,6 +89,7 @@ function install_dpdk() sed -i '/CONFIG_RTE_KNI_KMOD=y/s/=y/=n/' build/.config make -j4 CC=gcc EXTRA_CFLAGS='-fPIC' + EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/build" echo "Installed DPDK source in $(pwd)" cd .. } @@ -111,7 +112,6 @@ if [ "$DPDK" ] || [ "$DPDK_SHARED" ]; then # Disregard cast alignment errors until DPDK is fixed CFLAGS="$CFLAGS -Wno-cast-align" fi - EXTRA_OPTS="$EXTRA_OPTS --with-dpdk=$(pwd)/dpdk-$DPDK_VER/build" fi OPTS="$EXTRA_OPTS $*" -- cgit v1.2.1