Bug#606702: podebconf-display-po: stops on errors with debconf variable substitution

2011-01-26 Thread Denis Barbier
Martin Eberhard Schauer wrote:
 It should be considered whether the intended intentation is a must.

 #. Type: text
 #. Description
 #. The - is used to indicate indentation. Leading spaces may not work.
 #: ../grub-pc.templates.in:6001
 #| msgid ${DEVICE} (${SIZE} MB, ${MODEL})
 msgid - ${DEVICE} (${SIZE} MB, ${PATH})
 msgstr - ${DEVICE} (${SIZE} MB, ${PATH})

 There are no error messages without the minus sign.

This bug can be reproduced by running the following command:
  $ whiptail --msgbox '- ${DEVICE} (${SIZE} Mo, ${PATH})' 7 35
  - ${DEVICE} (${SIZE} Mo, ${PATH}): unknown option

See whiptail(1):
  NOTES
 whiptail interprets arguments starting with a dash - as being
arguments.  To avoid this, and start some text in, for example, a
menubox item, with a dash, whiptail honours the getopt convention of
accepting the special argument -- which means that all following
arguments with dashes are to be treated verbatim and not parsed as
options.

IMHO this bugreport should be reassigned to debconf, frontends should
take care of their peculiarities.  Here is a patch against
/usr/share/perl5/Debconf/FrontEnd/Dialog.pm to show how this problem
could get fixed.

I did not carefully check, but grub-pc seems to use this string to
substitute text, so it may not be affected by this bug.

Denis
--- /usr/share/perl5/Debconf/FrontEnd/Dialog.pm.orig
+++ /usr/share/perl5/Debconf/FrontEnd/Dialog.pm
@@ -119,10 +119,13 @@
 	my @lines = split(/\n/, $text);
 	my $num;
 	my @args=('--msgbox', join(\n, @lines));
+	if ($this-program eq 'whiptail'  $text =~ m/^-/s) {
+		@args=('--msgbox', '--', join(\n, @lines));
+	}
 	if ($lines - 4 - $this-borderheight = $#lines) {
 		$num=$lines - 4 - $this-borderheight;
 		if ($this-program eq 'whiptail') {
-			push @args, '--scrolltext';
+			unshift @args, '--scrolltext';
 		}
 		else {
 			my $fh=Debconf::TmpFile::open();


Bug#606702: podebconf-display-po: stops on errors with debconf variable substitution

2010-12-11 Thread Martin Eberhard Schauer

I can reproduce the errors here on lenny:

podebconf-display-po de.po
- ${DEVICE} (${SIZE} MB, ${PATH}): Unbekannte Option
debconf: whiptail output the above errors, giving up!

$podebconf-display-po grub.fr.po
- ${DEVICE} (${SIZE} Mo, ${PATH}): Unbekannte Option
debconf: whiptail output the above errors, giving up!

$dpkg -l po-debconf
Gewünscht=Unbekannt/Installieren/R=Entfernen/P=Vollständig Löschen/Halten
| Status=Nicht/Installiert/Config/U=Entpackt/Fehlgeschl. Konfiguration/
Halb installiert/Trigger erWartet/Trigger anhängig
|/ Fehler?=(kein)/Halten/R=Neuinst notw/X=beide (Status, Fehler: 
GROSS=schlecht)

||/ Name   VersionBeschreibung
+++-==-==-
ii  po-debconf 1.0.15 manage translated Debconf templates 
files wi


Martin



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#606702: Info received (Bug#606702: podebconf-display-po: stops on errors with debconf variable substitution)

2010-12-11 Thread Martin Eberhard Schauer

It should be considered whether the intended intentation is a must.

#. Type: text
#. Description
#. The - is used to indicate indentation. Leading spaces may not work.
#: ../grub-pc.templates.in:6001
#| msgid ${DEVICE} (${SIZE} MB, ${MODEL})
msgid - ${DEVICE} (${SIZE} MB, ${PATH})
msgstr - ${DEVICE} (${SIZE} MB, ${PATH})

There are no error messages without the minus sign.

Cheers
 Martin



--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#606702: podebconf-display-po: stops on errors with debconf variable substitution

2010-12-10 Thread Simon Paillard
Package: po-debconf
Version: 1.0.16

On Fri, Dec 10, 2010 at 06:55:18AM +0100, Christian PERRIER wrote:
 Quoting Slavko (li...@slavino.sk):
  i want test my updated translation of the grub2 debconf PO file,
  but while it i get this error message:
  
  $ LANG=C podebconf-display-po -fdialog grub2.po
  - ${DEVICE} (${SIZE} MB, ${PATH}): unknown option
  debconf: whiptail output the above errors, giving up!
  
  $ echo $?
  255
  
  and i can't see the rest of file, if any.
  
  please, need i some other params to podebconf-display-po?
 
 IIRC, podebconf-display-po doesn't handle variable substitution
 properly.

Example attached.

-- 
Simon Paillard
# translation of fr.po to French
# Translation of grub2 debconf templates to French
# Copyright (C) 2008-2010 Debian French l10n 
debian-l10n-fre...@lists.debian.org
# This file is distributed under the same license as the grub2 package.
#
# Christian Perrier bubu...@debian.org, 2007, 2008, 2009, 2010.
msgid 
msgstr 
Project-Id-Version: fr\n
Report-Msgid-Bugs-To: gr...@packages.debian.org\n
POT-Creation-Date: 2010-12-08 18:02-0400\n
PO-Revision-Date: 2010-12-11 00:04+0100\n
Last-Translator: Christian Perrier bubu...@debian.org\n
Language-Team: French debian-l10n-fre...@lists.debian.org\n
Language: fr\n
MIME-Version: 1.0\n
Content-Type: text/plain; charset=UTF-8\n
Content-Transfer-Encoding: 8bit\n
X-Generator: Lokalize 1.0\n
Plural-Forms: nplurals=2; plural=(n  1);\n

#. Type: boolean
#. Description
#: ../grub-pc.templates.in:2001
msgid Chainload from menu.lst?
msgstr Faut-il enchaîner le chargement depuis menu.lst ?

#. Type: boolean
#. Description
#: ../grub-pc.templates.in:2001
msgid GRUB upgrade scripts have detected a GRUB Legacy setup in /boot/grub.
msgstr Une installation standard de GRUB a été détectée dans /boot/grub.

#. Type: boolean
#. Description
#: ../grub-pc.templates.in:2001
#| msgid 
#| In order to replace the Legacy version of GRUB in your system, it is 
#| recommended that /boot/grub/menu.lst is adjusted to chainload GRUB 2 from 
#| your existing GRUB Legacy setup. This step may be automaticaly performed 
#| now.
msgid 
In order to replace the Legacy version of GRUB in your system, it is 
recommended that /boot/grub/menu.lst is adjusted to load a GRUB 2 boot image 
from your existing GRUB Legacy setup. This step can be automatically 
performed now.
msgstr 
Afin de remplacer cette installation, il est recommandé de modifier /boot/
grub/menu.lst pour charger GRUB 2 depuis l'installation standard de GRUB 
(« chainload »). Veuillez choisir si vous souhaitez effectuer cette 
modification.

#. Type: boolean
#. Description
#: ../grub-pc.templates.in:2001
#| msgid 
#| It's recommended that you accept chainloading GRUB 2 from menu.lst, and 
#| verify that your new GRUB 2 setup is functional for you, before you 
#| install it directly to your MBR (Master Boot Record).
msgid 
It's recommended that you accept chainloading GRUB 2 from menu.lst, and 
verify that the new GRUB 2 setup works before it is written to the MBR 
(Master Boot Record).
msgstr 
Il est recommandé de choisir cette option pour pouvoir confirmer le bon 
fonctionnement de GRUB 2 avant de l'installer directement sur le secteur 
d'amorçage (MBR : « Master Boot Record »).

#. Type: boolean
#. Description
#: ../grub-pc.templates.in:2001
msgid 
Whatever your decision, you can replace the old MBR image with GRUB 2 later 
by issuing the following command as root:
msgstr 
Quel que soit votre choix, vous pourrez, plus tard, remplacer l'ancien 
secteur d'amorçage par GRUB 2 avec la commande suivante, exécutée avec les 
privilèges du superutilisateur :

#. Type: multiselect
#. Description
#. Type: multiselect
#. Description
#: ../grub-pc.templates.in:3001 ../grub-pc.templates.in:4001
#| msgid GRUB failed to install to the following devices:
msgid GRUB install devices:
msgstr Périphériques où installer GRUB :

#. Type: multiselect
#. Description
#: ../grub-pc.templates.in:3001
msgid 
The grub-pc package is being upgraded. This menu allows you to select which 
devices you'd like grub-install to be automatically run for, if any.
msgstr 
Le paquet grub-pc est en cours de mise à jour. Ce menu permet de choisir 
pour quels périphériques vous souhaitez exécuter la commande grub-install 
automatiquement.

#. Type: multiselect
#. Description
#: ../grub-pc.templates.in:3001
msgid 
Running grub-install automatically is recommended in most situations, to 
prevent the installed GRUB core image from getting out of sync with GRUB 
modules or grub.cfg.
msgstr 
Il est en général recommandé d'exécuter grub-install automatiquement, afin 
d'éviter la situation où l'image de GRUB est désynchronisée avec les modules 
de GRUB ou le fichier grub.cfg.

#. Type: multiselect
#. Description
#. Type: multiselect
#. Description
#: ../grub-pc.templates.in:3001 ../grub-pc.templates.in:4001
msgid 
If you're unsure which drive is designated as boot drive by your BIOS, it is 
often a good idea to install GRUB to all of them.
msgstr