TVAM / winetricks

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

WINE variable (quoted) contains spaces -> Winetricks won't launch #345

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
1. Get a non-default wine version. Place it somewhere, so it's path contains 
spaces.
2. Use a command, like env WINEPREFIX="some/random/prefix" WINE="Path_to_the 
needed_wine_binary_containing_spaces" winetricks

Get two errors:
1) dirname says he's been given extra operands. 
And actually prints the path part after space as a proof. Or multiple parts, if 
your path contained multiple spaces.
2) "WINE is the_correct_full_path_to_the_binary which, is neither on the path 
nor an executable file". 

Looking at the first error, I assume, that only dirname looses the spaces, 
because the second error prints the correct path. BUT, maybe the second error 
is printing 2 pathes in one line, which causes the error.
After changing the directory name, which contained all my wineprefixes into a 
containing no spaces the winetricks launched with the correct wine binary.

Ubuntu 12.04 (it was a minimal install, though)
WINETRICKS_VERSION=20130707

An example output is given in the attachment.

Original issue reported on code.google.com by iw2...@gmail.com on 26 Aug 2013 at 3:12

Attachments:

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
I searched through the file for some seconds, and found a
dirname $WINE
in line 3522:
"`dirname $WINE`/server/wineserver" \

I'll check that, though, I don't know if that is what I should look for :) . 
(The comments part says it's the part that actually searches the wine binaries)

Original comment by iw2...@gmail.com on 26 Aug 2013 at 4:06

GoogleCodeExporter commented 8 years ago
I tried to quote that $WINE.
Now the line looks like 
"`dirname "$WINE"`/server/wineserver" \

dirname is not giving any errors now, but the second error is still present, so 
I assume there are still some spaces. Luckily, that error is just 50+ lines 
away.

Original comment by iw2...@gmail.com on 26 Aug 2013 at 4:27

GoogleCodeExporter commented 8 years ago
Unfortunetly, changing the 3547 line (quoting the $WINE) resulted in a new 
error, saying smth about "my binary" cmd \c returned empty string.
The line:
_abswine="`which "$WINE" 2>/dev/null`"

The I finally got to the 2063rd line, and quoted that too. (I know the comments 
said, that prefixes should contain no spaces etc, but this is the binary path 
:D )
That line is the only line contained in winetricks_early_wine() function:
WINEDEBUG=-all "$WINE" "$@" 2>/dev/null | ( sed 's/.*1h.=//' | tr -d '\r' | 
grep -v "Module not found" || true)

Now, looking for the terminal's output... my next stop is line 18005.
So... Is the meaning, that this issue won't ever be fixed ?

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:13

GoogleCodeExporter commented 8 years ago
However, the winetricks launched that way. I haven't tried the 18005 line yet 
(that one is calling the winecfg).

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:14

GoogleCodeExporter commented 8 years ago
Changing lines 18005-18007 resulted in winecfg, regedit and taskmgr being 
launched correctly, and the script now works like I wanted it to work. 

But I have no clue on how many other $WINE do I have to quote yet. :) .
So I'm really interested:
Is my "research" a waste of time and the issue won't ever be fixed, or it was 
something, that might help ?

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:18

GoogleCodeExporter commented 8 years ago
Spaces in filenames are intended to be supported by winetricks.

A patch to fix the problem would be welcome.

Original comment by daniel.r...@gmail.com on 26 Aug 2013 at 5:19

GoogleCodeExporter commented 8 years ago
Wow, I've got a respond! :)
The said above should underline that I'm actually a amateur at scripting, but...

$ sed -n '/\<WINE\>/p' <winetricks.sh | wc -l
205
I've quoted 4 of them already... :) 

I'll try to quote everything manually, to make sure no quoting is messed.

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:28

GoogleCodeExporter commented 8 years ago
That sounds painful :-)

I would do it with sed myself, and then just review the diff manually.

e.g.
  sed -i 's/ $WINE / "$WINE" /g' winetricks

for a first cut.

Original comment by daniel.r...@gmail.com on 26 Aug 2013 at 5:34

GoogleCodeExporter commented 8 years ago
I've thought of that too :) ...
Mhm... How about _$WINE`_ cases ? :) 

sed -n '/\$\<WINE\>/p' winetricks.sh | wc -l 
199, which is ... pretty much correct, I assume, because I've changed 6 values, 
before I posted that.

Well, I'll try to sed then :) . It's fun for me.

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:41

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Well, my 6 edited values have nothing to do with the fact, that this sed 
returned 199.
Those 6 are actually located in some comments and some commands, e.g. export 
WINE.

Original comment by iw2...@gmail.com on 26 Aug 2013 at 5:46

GoogleCodeExporter commented 8 years ago
Okay! 
It's my first patch ever :) 
I gazed in google a bit, and found out, that I had to use "diff -u"
So here it is...

Original comment by iw2...@gmail.com on 26 Aug 2013 at 6:48

Attachments:

GoogleCodeExporter commented 8 years ago
And a log, of what I actually did.

Hope it will help :). 

Original comment by iw2...@gmail.com on 26 Aug 2013 at 6:53

Attachments:

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

Original comment by austinenglish@gmail.com on 23 Sep 2013 at 8:34