Bug#779012: Two issues with /usr/bin/wine script

2015-12-11 Thread Jens Reyer
control: retitle -1 wine: test if multiarch is enabled fails with multiple 
foreign archs
control: tags -1 + pending

On 02/23/2015 09:38 AM, Erik de Castro Lopo wrote:
> a) On amd64 if fails when there more than one foreign-achitecture
> installed.
[...]
> b) The current script does not seamlessly handle both 32 and 64 bit
> binaries.

b) is also reported in e.g. #769234 (automatically detect and launch
wine32 or wine64). Your patch for it imo is to strict, I've come up
with another version in #769234. I'd suggest that we followup there
for b).

Your proposed patch for a) [1] does not work for people with
kfreebsd-i386 or hurd-i386 but no i386 as foreign-arch. I've committed
a fixed version with "-x" added to match whole lines.


On 04/02/2015 09:24 AM, Erik de Castro Lopo wrote:
> Each time the wine package gets upgraded, I have to manually re-apply
> this patch. It I don't, the tests for the 64 bit Windows build will
> fail.

Do the tests fail if you get any output? Because the code of issue a)
is only output, not an error/exit. Or did I miss something?

Greets
jre


[1] Relevant part from your patch:
-if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg 
--print-foreign-architectures)" != "i386" ]; then
+if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg 
--print-foreign-architectures | grep -c "i386")" -ne 1 ]; then



Bug#779012: Two issues with /usr/bin/wine script

2015-02-23 Thread Erik de Castro Lopo
Package: wine
Version: 1.6.2-19
Severity: normal
Tags: patch

Hi,

There are currently two issues with the /usr/bin/wine script:

a) On amd64 if fails when there more than one foreign-achitecture installed.
   For instance on my machine where I do a lot of cross-compiling from amd64
   to armhf and arm64:

> dpkg --print-foreign-architectures
i386
armhf
arm64
   which causes the existing foreign architecture test to fail.
   
b) The current script does not seamlessly handle both 32 and 64 bit binaries.
   Fortunately its trivial to add this support using file to detect whether
   the windows binary is 32 or 64 bit and then setting WINEPREFIX to either
   $HOME/.wine for 32 or $HOME/.wine64 for 64 bits.

Patch containing fixes for both these issues attached.

Cheers,
Erik

-- System Information:
Debian Release: 8.0
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable'), (500, 'testing-updates'), 
(500, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, arm64

Kernel: Linux 3.16.0-4-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8) (ignored: LC_ALL 
set to en_AU.UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages wine depends on:
ii  file1:5.20-2
ii  wine32  1.6.2-19
ii  wine64  1.6.2-19

wine recommends no packages.

Versions of packages wine suggests:
pn  avscan | klamav | clamav   
ii  binfmt-support 2.1.5-1
ii  ttf-mscorefonts-installer  3.6
pn  winbind

-- no debconf information
--- /usr/bin/wine	2015-01-11 05:40:21.0 +1100
+++ usr_bin_wine	2015-01-05 21:15:03.311892601 +1100
@@ -6,11 +6,22 @@
 wine32=$bindir/wine32
 wine64=$bindir/wine64
 
+if test -z "${WINEARCH}${WINEPREFIX}" ; then
+if test $(file $1 | grep -c 'Intel 80386') -eq 1 ; then
+WINEARCH=win32
+WINEPREFIX=$HOME/.wine
+elif test $(file $1 | grep -c 'x86-64') -eq 1 ; then
+WINEARCH=win64
+WINEPREFIX=$HOME/.wine64
+fi
+fi
+
+
 if test -x $wine32 -a "$WINEARCH" != "win64"; then
 wine=$wine32
 elif test -x $wine64; then
 wine=$wine64
-if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures)" != "i386" ]; then
+if [ "$(dpkg --print-architecture)" = "amd64" -a "$(dpkg --print-foreign-architectures | grep -c "i386")" -ne 1 ]; then
 echo "it looks like multiarch needs to be enabled.  as root, please"
 echo "execute \"dpkg --add-architecture i386 && apt-get update &&"
 echo "apt-get install $(echo $name | sed s/wine/wine32/)\""