Fix remove-rpath script
[vpp.git] / build-root / scripts / remove-rpath
1 #!/bin/bash
2
3 if [ -z $1 ]; then
4         echo "Please specify path"
5         exit 1
6 fi
7
8 which chrpath &> /dev/null
9
10 if [ $? -ne 0 ] ; then
11         echo "Please install chrpath tool"
12         exit 1
13 fi
14
15 libs=$(find $1 -type f -name \*.so)
16 execs=$(find $1 -type f -path \*/bin/\* )
17
18 for i in $libs $execs; do
19         chrpath $i 2> /dev/null | grep -q build-root
20         if [ $? -eq 0 ] ; then
21                 chrpath -d $i
22         fi
23 done
24