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

Modified Files:
Log Message:
Use mktemp to generate a temporary dir (thanks, dmacks)

Index: deb-relocator
RCS file: /cvsroot/fink/experimental/alexkhansen/maintainertools/deb-relocator,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- deb-relocator       18 Aug 2006 02:25:56 -0000      1.2
+++ deb-relocator       18 Aug 2006 02:45:29 -0000      1.3
@@ -28,21 +28,20 @@
 echo "Extracting files"
 DEBFILE=$(basename $1 .deb)
-echo $DEBFILE
-rm -r /tmp/$DEBFILE
-mkdir -p /tmp/$DEBFILE
+TMPDIR=$(mktemp -d)
+#echo $TMPDIR
-dpkg -x $1 /tmp/$DEBFILE
-dpkg -e $1 /tmp/$DEBFILE/DEBIAN
+dpkg -x $1 $TMPDIR
+dpkg -e $1 $TMPDIR/DEBIAN
 # locate the Mach-O stuff
 echo "Locating Mach-O binaries"
-/usr/bin/find /tmp/$DEBFILE/$NEWROOT  | xargs /usr/bin/file | grep Mach-O | 
cut -d : -f 1 | while read FILE ; do
+/usr/bin/find $TMPDIR/$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
@@ -54,8 +53,8 @@
 # convert text files
 echo "Modifying text files"
-#grep -IRl "/$OLDROOT/" /tmp/$DEBFILE
-grep -IRl "/$OLDROOT/" /tmp/$DEBFILE | while read FILETOCHANGE; do
+#grep -IRl "/$OLDROOT/" $TMPDIR
+grep -IRl "/$OLDROOT/" $TMPDIR | while read FILETOCHANGE; do
 sed -i -e 's|\/'$OLDROOT'\/|\/'$NEWROOT'\/|g' $FILETOCHANGE 
@@ -63,7 +62,7 @@
 #Pack it up
 echo "Repackaging"
 rm $DEBFILE.deb
-dpkg -b /tmp/$DEBFILE $DEBFILE.deb
+dpkg -b $TMPDIR $DEBFILE.deb
 echo "Cleaning up temporary files"
-#rm -rf /tmp/$DEBFILE
+rm -rf $TMPDIR

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
Fink-commits mailing list

Reply via email to