Update of /cvsroot/fink/experimental/alexkhansen/maintainertools
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv11956/maintainertools

Modified Files:
        deb-relocator 
Log Message:
Getting better

Index: deb-relocator
===================================================================
RCS file: /cvsroot/fink/experimental/alexkhansen/maintainertools/deb-relocator,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- deb-relocator       18 Aug 2006 01:08:03 -0000      1.1
+++ deb-relocator       18 Aug 2006 02:25:56 -0000      1.2
@@ -6,7 +6,8 @@
        echo "deb-relocator FILENAME OLDPREFIX NEWPREFIX"
        echo " -or- "
        echo "deb-relocator FILENAME NEWPREFIX"
-       echo "which assumes the old prefix is /sw"
+       echo "which assumes the old prefix is sw .  Specify prefixes without 
leading"
+       echo "or trailing slashes"
        echo "Unpacks a .deb file, converts OLDPREFIX to NEWPREFIX in all text 
files"
        echo "and within Mach-O binaries, and then repacks it in the current 
working"
        echo "directory"
@@ -17,7 +18,7 @@
 exit 1
 fi
 if [ -z $3 ]; then
-       OLDROOT=/sw
+       OLDROOT=sw
        NEWROOT=$2
 else 
        OLDROOT=$2
@@ -35,31 +36,34 @@
 dpkg -x $1 /tmp/$DEBFILE
 dpkg -e $1 /tmp/$DEBFILE/DEBIAN
 
-mv /tmp/$DEBFILE$OLDROOT /tmp/$DEBFILE$NEWROOT
+mv /tmp/$DEBFILE/$OLDROOT /tmp/$DEBFILE/$NEWROOT
 
 # locate the Mach-O stuff
 
 echo "Locating Mach-O binaries"
 
-find /tmp/$DEBFILE$NEWROOT * | xargs file | grep Mach-O | cut -d : -f 1 | 
while read FILE ; do
+/usr/bin/find /tmp/$DEBFILE/$NEWROOT  | xargs /usr/bin/file | grep Mach-O | 
cut -d : -f 1 | while read FILE ; do
        echo $FILE
        echo "Converting references..."
-       otool -L $FILE | grep dylib | grep $OLDROOT/ | cut -d "(" -f 1 | while 
read OLDLIB; do
-               echo $OLDLIB "--->" $( echo $OLDLIB | sed -e 
's|'$OLDROOT'\/|'$NEWROOT'\/|' ) 
-               install_name_tool -change $OLDLIB $( echo $OLDLIB | sed -e 
's|'$OLDROOT'\/|'$NEWROOT'\/|' ) $FILE
+       otool -L $FILE | grep dylib | grep /$OLDROOT/ | cut -d "(" -f 1 | while 
read OLDLIB; do
+               echo $OLDLIB "--->" $( echo $OLDLIB | sed -e 
's|\/'$OLDROOT'\/|\/'$NEWROOT'\/|' ) 
+               install_name_tool -change $OLDLIB $( echo $OLDLIB | sed -e 
's|\/'$OLDROOT'\/|\/'$NEWROOT'\/|' ) $FILE
                done            
 done
 
 # convert text files
 
 echo "Modifying text files"
-
-grep -IRl "$OLDROOT/" /tmp/$DEBFILE
-grep -IRl "$OLDROOT/" /tmp/$DEBFILE | xargs sed -ie 
's|'$OLDROOT'\/|'$NEWROOT'\/|'
-
+#grep -IRl "/$OLDROOT/" /tmp/$DEBFILE
+grep -IRl "/$OLDROOT/" /tmp/$DEBFILE | while read FILETOCHANGE; do
+echo $FILETOCHANGE
+sed -i -e 's|\/'$OLDROOT'\/|\/'$NEWROOT'\/|g' $FILETOCHANGE 
+#
+done
 #Pack it up
 echo "Repackaging"
+rm $DEBFILE.deb
 dpkg -b /tmp/$DEBFILE $DEBFILE.deb
 echo "Cleaning up temporary files"
-rm -rf /tmp/$DEBFILE
+#rm -rf /tmp/$DEBFILE
 fi


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to