[vlc-devel] commit: contrib: Fix change_prefix when used on binaries != libraries ( Derk-Jan Hartman )

git version control git at videolan.org
Mon Oct 13 01:01:44 CEST 2008


vlc | branch: master | Derk-Jan Hartman <hartman at videolan.org> | Mon Oct 13 00:43:32 2008 +0200| [33a19efb3450a51037fd20bb09c0faad85514ce1] | committer: Derk-Jan Hartman 

contrib: Fix change_prefix when used on binaries != libraries

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=33a19efb3450a51037fd20bb09c0faad85514ce1
---

 extras/contrib/change_prefix.sh |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/extras/contrib/change_prefix.sh b/extras/contrib/change_prefix.sh
index a55339f..9b1b004 100755
--- a/extras/contrib/change_prefix.sh
+++ b/extras/contrib/change_prefix.sh
@@ -48,17 +48,20 @@ files=`find . -type f`
 for file in $files; do 
  if test ".`file $file | grep Mach-O`" != "." ; then
     echo "Changing prefixes of '$file'"
+    islib=n
+    if test ".`file $file | grep 'Mach-O dynamically'`" != "." ; then
+      islib=y
+    fi
     libs=`otool -L $file 2>/dev/null | grep $prefix | cut -d\  -f 1`
-    WD=`pwd`
     first=y
     for i in "" $libs; do
-     if ! test -z $i; then
-         if test $first = y; then
+      if ! test -z $i; then
+        if test $islib = y -a $first = y; then
             install_name_tool -id `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
             first=n
         else
             install_name_tool -change $i `echo $i | sed -e "s,$prefix,$new_prefix,"` $file
-         fi
+        fi
       fi
     done
   elif test ".`file $file | grep \"text\|shell\"`" != "." ; then




More information about the vlc-devel mailing list