Dave Barach | 7457422 | 2016-02-01 12:05:52 -0500 | [diff] [blame] | 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 | |
Dave Wallace | 9c5b2b3 | 2016-05-13 22:49:36 -0400 | [diff] [blame] | 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 |
Dave Barach | 7457422 | 2016-02-01 12:05:52 -0500 | [diff] [blame] | 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 | |