Package: fakeroot
Version: 1.20-3
Severity: minor
Tags: patch

Hi,

(Forgot to send this earlier)

An user of fakeroot under a Dutch locale reported that fakeroot (and
fakeroot using apps) was broken under this locale:
https://bugs.launchpad.net/ubuntu/+source/fakeroot/+bug/1290069

This is because the fakeroot wrapper shell script attempts parsing of
the gettext --version output. One option would be to set locale to C
before parsing version output, but since the goal is to test whether
we have GNU getopt, and since there's a special -T flag to test this,
this is what the patch does.

(See attached debdiff and patch)

Cheers,
-- 
Loïc Minier
diff -Nru fakeroot-1.20/debian/changelog fakeroot-1.20/debian/changelog
--- fakeroot-1.20/debian/changelog      2014-03-24 05:52:53.000000000 +0100
+++ fakeroot-1.20/debian/changelog      2014-05-20 15:11:19.000000000 +0200
@@ -1,3 +1,10 @@
+fakeroot (1.20-3ubuntu3) utopic; urgency=medium
+
+  * New patch, getopt-gnu-test, use "getopt -T" to test for GNU getopt rather
+    than parsing the --version output which is locale specific; LP: #1290069.
+
+ -- Loïc Minier <loic.min...@ubuntu.com>  Tue, 20 May 2014 15:10:08 +0200
+
 fakeroot (1.20-3ubuntu2) trusty; urgency=medium
 
   * fix-xattr-prototypes.patch: Fix prototypes for xattr functions.
diff -Nru fakeroot-1.20/debian/patches/getopt-gnu-test.patch 
fakeroot-1.20/debian/patches/getopt-gnu-test.patch
--- fakeroot-1.20/debian/patches/getopt-gnu-test.patch  1970-01-01 
01:00:00.000000000 +0100
+++ fakeroot-1.20/debian/patches/getopt-gnu-test.patch  2014-05-20 
15:09:07.000000000 +0200
@@ -0,0 +1,24 @@
+Index: fakeroot-1.20/scripts/fakeroot.in
+===================================================================
+--- fakeroot-1.20.orig/scripts/fakeroot.in
++++ fakeroot-1.20/scripts/fakeroot.in
+@@ -43,15 +43,12 @@ export FAKED_MODE
+ 
+ libfound=no
+ 
+-GETOPTEST=`getopt --version`
+-case $GETOPTEST in
+-getopt*) # GNU getopt
++GETOPTTEST=`getopt -T`
++if test "$?" -eq 4; then # GNU getopt
+     FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l 
version -l help -- +l:f:i:s:ub:vh "$@"`
+-    ;;
+-*) # POSIX getopt ?
++else
+     FAKE_TEMP=`getopt l:f:i:s:ub:vh "$@"`
+-    ;;
+-esac
++fi
+ 
+ if test "$?" -ne 0; then
+   usage
diff -Nru fakeroot-1.20/debian/patches/series 
fakeroot-1.20/debian/patches/series
--- fakeroot-1.20/debian/patches/series 2014-03-24 05:53:23.000000000 +0100
+++ fakeroot-1.20/debian/patches/series 2014-05-20 15:08:55.000000000 +0200
@@ -2,3 +2,4 @@
 Fix-FTBFS
 powerpc64le-support.patch
 fix-xattr-prototypes.patch
+getopt-gnu-test.patch
Index: fakeroot-1.20/scripts/fakeroot.in
===================================================================
--- fakeroot-1.20.orig/scripts/fakeroot.in
+++ fakeroot-1.20/scripts/fakeroot.in
@@ -43,15 +43,12 @@ export FAKED_MODE
 
 libfound=no
 
-GETOPTEST=`getopt --version`
-case $GETOPTEST in
-getopt*) # GNU getopt
+GETOPTTEST=`getopt -T`
+if test "$?" -eq 4; then # GNU getopt
     FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l version -l help -- +l:f:i:s:ub:vh "$@"`
-    ;;
-*) # POSIX getopt ?
+else
     FAKE_TEMP=`getopt l:f:i:s:ub:vh "$@"`
-    ;;
-esac
+fi
 
 if test "$?" -ne 0; then
   usage

Reply via email to