Remove "Path" lines from sample config

Saulius Krasuckas saulius2 at ar.fi.lt
Wed Apr 14 11:10:20 CDT 2004


> Changelog:
> Remove "Path" lines from sample config.
> Setup the links for the default DOS drives in wineinstall.

hey, it is plain and simple change but it makes me disappointed right
after second reinstall of Wine. GNU ln when encounters existing target
(link to directory, in fact) creates a sym-link with the name of original
target already in mentioned symlinked dir.

that we are getting is like a:
ln: `/home/s2/.wine/dosdevices/c:/c': File exists

and this:
lrwxrwxrwx    1 s2       s2             10 Apr 14 15:36 /home/s2/.wine/dosdevices/c: -> /home/s2/c
lrwxrwxrwx    1 s2       s2             10 Apr 14 15:58 /home/s2/.wine/dosdevices/c:/c -> /home/s2/c

as that does not belong to Wine binary (it is more to config of
Wine-user), i'd not like to change existing dosdevices/ symlinks during
"make uninstall" or even "tools/wineinstall". OK, maybe target should only
be removed if it is not a symlink.

so, what about some additional small bash function?

Index: wine/tools/wineinstall
===================================================================
RCS file: /home/wine/wine/tools/wineinstall,v
retrieving revision 1.67
diff -u -r1.67 wineinstall
--- wine/tools/wineinstall      12 Apr 2004 22:05:00 -0000      1.67
+++ wine/tools/wineinstall      14 Apr 2004 14:54:05 -0000
@@ -140,6 +140,16 @@
   link_app winebrowser  "$CROOT/windows/winebrowser.exe"
 }
 
+function link_file_safely {
+  # makes link to target if link does not exist already
+  #  parameters: 
+  # $1 - path to target,
+  # $2 - path to link name
+  if [ -L $2 ]; then return 1; fi
+  if [ -e $2 ]; then return 2; fi
+  ln -s $1 $2
+} 
+
 # startup...
 
 echo "WINE Installer v0.74"
@@ -600,12 +610,12 @@
   echo "Preparing to install default Wine registry entries..."
 
   # Make sure we are on a Windows drive
-  ln -s /mnt/fd0 ~/.wine/dosdevices/a:
-  ln -s $CROOT ~/.wine/dosdevices/c:
-  ln -s /cdrom ~/.wine/dosdevices/d:
-  ln -s /tmp ~/.wine/dosdevices/e:
-  ln -s ~ ~/.wine/dosdevices/f:
-  ln -s / ~/.wine/dosdevices/z:
+  link_file_safely /mnt/fd0 ~/.wine/dosdevices/a:
+  link_file_safely $CROOT   ~/.wine/dosdevices/c:
+  link_file_safely /cdrom   ~/.wine/dosdevices/d:
+  link_file_safely /tmp     ~/.wine/dosdevices/e:
+  link_file_safely ~        ~/.wine/dosdevices/f:
+  link_file_safely /        ~/.wine/dosdevices/z:
 
   echo "Installing default Wine registry entries..."
   echo


PS and yes, that double check in "link_file_safely" function (one for
existing target/link with a given name and second about target being some
file of other kind) may be overhead.

PPS IMHO it could be nice to eliminate overhead of multiple passing string
"~/.wine/dosdevices/" by assigning its value to some script variable and
by putting out that block into separate function, say some "mk_dosdevices"
or like. ughm?




More information about the wine-devel mailing list