TVAM / winetricks

Automatically exported from code.google.com/p/winetricks
0 stars 0 forks source link

patch: sandbox support for Lithuanian and Polish #346

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Follow up on my German one. I started with most green languages from 
http://fgouget.free.fr/wine-po/ as they aren't likely to change, but i filtered 
out every language that uses suspect characters in those folder names. That's 
why i only can present two new here :) ...
SMGA? ;D

Index: src/winetricks
===================================================================
--- src/winetricks  (Revision 1051)
+++ src/winetricks  (Arbeitskopie)
@@ -17484,6 +17484,7 @@
     # Might want to unpack gecko first, since Wine won't be able to get to /usr/lib/wine after this
     rm -f "$WINEPREFIX/dosdevices/z:"

+    # English (old style)
     if test -d "$WINEPREFIX/drive_c/users/$USER/Documents"
     then
         for dir in Desktop Documents Music Pictures Videos
@@ -17491,6 +17492,7 @@
             rm -f "$WINEPREFIX/drive_c/users/$USER/$dir" > /dev/null 2>&1
             mkdir -p "$WINEPREFIX/drive_c/users/$USER/$dir"
         done
+    # English
     elif test -d "$WINEPREFIX/drive_c/users/$USER/My Documents"
     then
         for dir in Desktop "My Documents" "My Music" "My Pictures" "My Videos"
@@ -17498,6 +17500,7 @@
             rm -f "$WINEPREFIX/drive_c/users/$USER/$dir" > /dev/null 2>&1
             mkdir -p "$WINEPREFIX/drive_c/users/$USER/$dir"
         done
+    # German
     elif test -d "$WINEPREFIX/drive_c/users/$USER/Meine Dokumente"
     then
         for dir in Desktop "Meine Dokumente" "Eigene Musik" "Eigene Bilder" "Eigene Videos"
@@ -17505,6 +17508,22 @@
             rm -f "$WINEPREFIX/drive_c/users/$USER/$dir" > /dev/null 2>&1
             mkdir -p "$WINEPREFIX/drive_c/users/$USER/$dir"
         done
+    # Lithuanian
+    elif test -d "$WINEPREFIX/drive_c/users/$USER/Dokumentai"
+    then
+        for dir in Darbalaukis Dokumentai Muzika Paveikslai Vaizdai
+        do
+            rm -f "$WINEPREFIX/drive_c/users/$USER/$dir" > /dev/null 2>&1
+            mkdir -p "$WINEPREFIX/drive_c/users/$USER/$dir"
+        done
+    # Polish
+    elif test -d "$WINEPREFIX/drive_c/users/$USER/Moje Dokumenty"
+    then
+        for dir in Pulpit "Moje Dokumenty" "Moja muzyka" "Moje obrazy" "Moje 
wideo"
+        do
+            rm -f "$WINEPREFIX/drive_c/users/$USER/$dir" > /dev/null 2>&1
+            mkdir -p "$WINEPREFIX/drive_c/users/$USER/$dir"
+        done
     else
         w_die "don't know name of My Documents folder, can't sandbox"
     fi

Original issue reported on code.google.com by Dawncrow...@googlemail.com on 26 Aug 2013 at 6:06

GoogleCodeExporter commented 8 years ago
I first thought "Let's see if we can remove repeated code" (see attachment)
but then I realized "hey, we could be missing some symlinks, let's just
scan the user directory, looking for all symlinks, and turning them into 
directories".
That would be shorter and would handle all languages.

Wanna try it, or should I?

(BTW I prefer patches as attachments, I think, though this one was fine.)

Original comment by daniel.r...@gmail.com on 27 Aug 2013 at 12:22

Attachments:

GoogleCodeExporter commented 8 years ago
Good idea! I was too focused on the translation side of the problem :/

I did some research and i suggest something like:
find -type l -size 1c -exec rm '{}' \; -exec mkdir '{}' \;

But as i'm not that bash expert, am totally unsure about the size parameter and 
don't know if two execs will always act like this, i'd prefer if you could do 
the rest of the job. i used the size parameter to identify symlinks to 
directories, most likely filesystem dependent...

Original comment by Dawncrow...@googlemail.com on 27 Aug 2013 at 5:08

GoogleCodeExporter commented 8 years ago
This patch only checks for symlinks in the user directory, but should be 
generic enough.

Comments?

Original comment by austinenglish@gmail.com on 5 Sep 2013 at 12:04

Attachments:

GoogleCodeExporter commented 8 years ago
Didn't test that, but it looks quite good!

Original comment by Dawncrow...@googlemail.com on 5 Sep 2013 at 4:44

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r1056.

Original comment by austinenglish@gmail.com on 5 Sep 2013 at 7:31