winelauncher: $TMP patch

Francois Gouget fgouget at free.fr
Wed Sep 12 21:51:14 CDT 2001


Suggested by fvw.wine at var.cx (see bug 319).
http://wine.codeweavers.com/bugzilla/show_bug.cgi?id=319


Changelog:

 * tools/winelauncher.in

   Place the log in $TMP if set and /tmp otherwise



--
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
 "Only wimps use tape backup: _real_ men just upload their important stuff on
       ftp, and let the rest of the world mirror it ;)" -- Linus Torvalds
-------------- next part --------------
Index: tools/winelauncher.in
===================================================================
RCS file: /home/wine/wine/tools/winelauncher.in,v
retrieving revision 1.10
diff -u -r1.10 winelauncher.in
--- tools/winelauncher.in	2001/09/10 23:02:02	1.10
+++ tools/winelauncher.in	2001/09/13 01:31:17
@@ -364,13 +364,18 @@
 #------------------------------------------------------------------------------
 #  Generate a temporary log file name
 #------------------------------------------------------------------------------
+if [ -n "$TMP" ] ; then
+  log_dir="$TMP"
+else
+  log_dir="/tmp"
+fi
 use_log_name=0
-log_name=`mktemp /tmp/wine.log.XXXXXX`
+log_name=`mktemp "$log_dir/wine.log.XXXXXX"`
 if [ $? -eq 0 ] ; then
     use_log_name=1
 fi
 use_status_name=0
-status_name=`mktemp /tmp/wine.status.XXXXXX`
+status_name=`mktemp "$log_dir/wine.status.XXXXXX"`
 if [ $? -eq 0 ] ; then
     use_status_name=1
 fi
@@ -379,7 +384,7 @@
 #  Okay, really launch Wine...
 #------------------------------------------------------------------------------
 if [ $use_log_name -ne 0 -a $use_status_name -ne 0 ] ; then
-    ( $WINEBIN/$WINE_BIN_NAME "$@"; echo $? >$status_name ) 2>&1 | tee $log_name
+    ( $WINEBIN/$WINE_BIN_NAME "$@"; echo $? >$status_name ) 2>&1 | tee "$log_name"
     wine_return=`cat $status_name`
 else
     $WINEBIN/$WINE_BIN_NAME "$@"
@@ -395,7 +400,7 @@
 if [ $always_see_output -eq 0 -a $wine_return -eq 0 ] ; then
     echo "Wine exited with a successful status"
     if [ $use_log_name -ne 0 ] ; then
-        rm -f $log_name
+        rm -f "$log_name"
     fi
 else
     if [ $always_see_output -eq 0 ] ; then
@@ -490,10 +495,10 @@
         #  Process a view instruction
         #------------------------------------------------------------------------------
         if [ $debug_return -eq 1 ] ; then
-            $XMESSAGE -title "View Wine Log" -file $log_name -buttons "  Okay  ":0,"Delete $log_name":1  
+            $XMESSAGE -title "View Wine Log" -file "$log_name" -buttons "  Okay  ":0,"Delete $log_name":1  
             if [ $? -eq 1 ] ; then
                 echo "Deleting $log_name"
-                rm -f $log_name
+                rm -f "$log_name"
                 use_log_name=0
             fi
         else


More information about the wine-patches mailing list