vpp/build-root/scripts/find-dpdk-contents
Dave Wallace 9c5b2b301c VPP-64: Fix top-level "make pkg-deb" which breaks if CDPATH is set in the user's
bash environment.

Change-Id: Ib13e6fdafa67175937e57fad4e75e553cb1e08a3
Signed-off-by: Dave Wallace <dwallacelf@gmail.com>
2016-05-16 11:47:05 +00:00

30 lines
835 B
Bash
Executable File

#!/bin/bash
# includes
rm -rf dpdk-includes
mkdir dpdk-includes
(cd $1/dpdk/include; tar cfh - . | (cd ../../../dpdk-includes; tar xf -))
# If CDPATH is set, the "Change Directory" builtin (cd) will output the
# destination directory when a relative path is passed as an argument.
# In this case, this has the negative side effect of polluting the "paths"
# variable with the destination directory, breaking the package generation.
#
# Patient: Doctor! Doctor! It hurts when I do this...
# Doctor: Don't do that!
#
unset CDPATH
paths=`cd dpdk-includes; find . -type f -print`
rm -f $2
for path in $paths
do
dir=`dirname $path`
if [ $dir = "." ] ; then
echo ../dpdk-includes/$path /usr/include/vpp-dpdk >> $2
else
echo ../dpdk-includes/$path /usr/include/vpp-dpdk/$dir >> $2
fi
done