Bad identification of getopt in /usr/bin/fakeroot-sysv with some translations

Bug #1290069 reported by Sam Segers
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
fakeroot (Debian)
Fix Released
Unknown
fakeroot (Ubuntu)
Fix Released
Undecided
Loïc Minier

Bug Description

When running fakeroot in a Dutch enviroment, It fails to identify some arguments like --version with:
"getopt: onbekende optie '--version'
fakeroot, create a fake root environment.
   usage: fakeroot [-l|--lib fakerootlib] [-f|--faked fakedbin]
                   [-i file] [-s file] [-u|--unknown-is-real]
     [-b|--fd-base fd] [-h|--help] [-v|--version]
                   [--] [command]"

This happens because of line 46 in the fakeroot-sysv script.
In English the command 'getopt --version' returns "getopt from util-linux 2.20.1" but in Dutch it returns "'getopt' uit util-linux 2.20.1" (with the " ' " 's)

The following gets bad interpreted:

 46 GETOPTEST=`getopt --version`
 47 case $GETOPTEST in
 48 getopt*) # GNU getopt
 49 FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l fd-base: -l ve rsion -l help -- +l:f:i:s:ub:vh "$@"`
 50 ;;
 51 *) # POSIX getopt ?
 52 FAKE_TEMP=`getopt l:f:i:s:ub:vh "$@"`
 53 ;;
 54 esac

The POSIX getopt ? case is followed and fakeroot doesn't work as intended.

Tags: patch
Revision history for this message
Sam Segers (sam-sgrs) wrote :

Temporary/hacky solution is to add:
GETOPTEST="getopt"
after line 46

Revision history for this message
Sam Segers (sam-sgrs) wrote :
Revision history for this message
Loïc Minier (lool) wrote :

Proposed fix is attached; alternate approach would be to call getopt under LC_ALL, but the --version parsing seems hackish when -T is available.

Changed in fakeroot (Ubuntu):
assignee: nobody → Loïc Minier (lool)
status: New → In Progress
Revision history for this message
Loïc Minier (lool) wrote :

Testing: I've done a test build (hello-debhelper) with a binary build of fakeroot with the change and have confirmed that the issue goes away under nl locale.

tags: added: patch
Loïc Minier (lool)
Changed in fakeroot (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fakeroot - 1.20-3ubuntu3

---------------
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.
 -- Loic Minier <email address hidden> Tue, 20 May 2014 15:10:08 +0200

Changed in fakeroot (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Sam Segers (sam-sgrs) wrote : Re: [Bug 1290069] Re: Bad identification of getopt in /usr/bin/fakeroot-sysv with some translations

It's fixed now on Utopic
Thanks
Op 21-mei-2014 12:01 schreef "Launchpad Bug Tracker" <
<email address hidden>>:

> This bug was fixed in the package fakeroot - 1.20-3ubuntu3
>
> ---------------
> 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.
> -- Loic Minier <email address hidden> Tue, 20 May 2014 15:10:08 +0200
>
> ** Changed in: fakeroot (Ubuntu)
> Status: Fix Committed => Fix Released
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1290069
>
> Title:
> Bad identification of getopt in /usr/bin/fakeroot-sysv with some
> translations
>
> Status in “fakeroot” package in Ubuntu:
> Fix Released
>
> Bug description:
> When running fakeroot in a Dutch enviroment, It fails to identify some
> arguments like --version with:
> "getopt: onbekende optie '--version'
> fakeroot, create a fake root environment.
> usage: fakeroot [-l|--lib fakerootlib] [-f|--faked fakedbin]
> [-i file] [-s file] [-u|--unknown-is-real]
> [-b|--fd-base fd] [-h|--help] [-v|--version]
> [--] [command]"
>
> This happens because of line 46 in the fakeroot-sysv script.
> In English the command 'getopt --version' returns "getopt from
> util-linux 2.20.1" but in Dutch it returns "'getopt' uit util-linux 2.20.1"
> (with the " ' " 's)
>
> The following gets bad interpreted:
>
> 46 GETOPTEST=`getopt --version`
> 47 case $GETOPTEST in
> 48 getopt*) # GNU getopt
> 49 FAKE_TEMP=`getopt -l lib: -l faked: -l unknown-is-real -l
> fd-base: -l ve rsion -l help -- +l:f:i:s:ub:vh "$@"`
> 50 ;;
> 51 *) # POSIX getopt ?
> 52 FAKE_TEMP=`getopt l:f:i:s:ub:vh "$@"`
> 53 ;;
> 54 esac
>
> The POSIX getopt ? case is followed and fakeroot doesn't work as
> intended.
>
> To manage notifications about this bug go to:
>
> https://bugs.launchpad.net/ubuntu/+source/fakeroot/+bug/1290069/+subscriptions
>

Revision history for this message
Raffi Enficiaud (raffi-enficiaud-x) wrote :

Any chance to get a backport of 1.20-3ubuntu3 on 14.04?
Thanks!

Changed in fakeroot (Debian):
importance: Undecided → Unknown
status: New → Unknown
Changed in fakeroot (Debian):
status: Unknown → New
Changed in fakeroot (Debian):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.