Fix coverity warning, VPP-608
[vpp.git] / build-root / scripts / find-dpdk-contents
1 #!/bin/bash
2
3 # includes
4 rm -rf dpdk-includes
5 mkdir dpdk-includes
6 (cd $1/dpdk/include; tar cfh - . | (cd ../../../dpdk-includes; tar xf -))
7
8 # If CDPATH is set, the "Change Directory" builtin (cd) will output the
9 # destination directory when a relative path is passed as an argument.
10 # In this case, this has the negative side effect of polluting the "paths"
11 # variable with the destination directory, breaking the package generation.
12 #
13 #   Patient:  Doctor!  Doctor!  It hurts when I do this...
14 #    Doctor:  Don't do that!
15 #
16 unset CDPATH
17 paths=`cd dpdk-includes; find . -type f -print`
18 rm -f $2
19
20 for path in $paths
21 do
22     dir=`dirname $path`
23     if [ $dir = "." ] ; then
24         echo ../dpdk-includes/$path /usr/include/vpp-dpdk >> $2
25     else
26         echo ../dpdk-includes/$path /usr/include/vpp-dpdk/$dir >> $2
27     fi
28 done        
29