(Marc pinged me on IRC about this bug report in adduser) First of all, I think that adduser should probably make better use of the locales information for this Yes/No answer. I don''t have the required skills to lead you to the solution, Marc, but I think that Denis Barbier could. Yes/No handling is coded in locales files and there are probably correct Perl handling possible. With a correct use of this, then any key among "Y", "y", "O" and "o" will be a correct "yes" answer and "N" and "n" will be correct "no" answers. Anyway, to quickly solve this, you certainly can add the following in the fr.po file for adduser: msgid "y" msgstr "o" msgid "n" msgstr "n" This fr.po file for adduser is under work now and you should soon have a new version anyway with these fixes among others. In the original bug report, the submitter could "answer" "yes" by hitting "j" because his locales set lists first a French locale (in which "y" is not "translated") then a German locale (where "y" is "translated" to "j"). --
Marc Haber
2005-Oct-21 07:33 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Fri, Oct 21, 2005 at 08:36:10AM +0200, Christian Perrier wrote:> (Marc pinged me on IRC about this bug report in adduser)Thanks for your help!> First of all, I think that adduser should probably make better use of > the locales information for this Yes/No answer.I think that would be a good idea here.> I don''t have the required skills to lead you to the solution, Marc, > but I think that Denis Barbier could.Thanks for directly Ccing him, I hope that he can find the time to help.> This fr.po file for adduser is under work now and you should soon have > a new version anyway with these fixes among others.OK, I''ll wait for that before applying stuff. Better not mess with things that I don''t understand. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Christian Perrier
2005-Oct-21 17:33 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
> > This fr.po file for adduser is under work now and you should soon have > > a new version anyway with these fixes among others. > > OK, I''ll wait for that before applying stuff. Better not mess with > things that I don''t understand.You should also have an incoming mail by Thomas Huriaux (thomash on IRC) who mentioned me a problem in the package build system, as the package is built with svn-buildpackage, but re-synced PO files are not re-commited to your SVN...which is thus always outdated..:-) (at least, this is Thomas analysis)
Marc Haber
2005-Oct-21 18:03 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Fri, Oct 21, 2005 at 06:03:34PM +0200, Christian Perrier wrote:> > > This fr.po file for adduser is under work now and you should soon have > > > a new version anyway with these fixes among others. > > > > OK, I''ll wait for that before applying stuff. Better not mess with > > things that I don''t understand. > > You should also have an incoming mail by Thomas Huriaux (thomash on > IRC) who mentioned me a problem in the package build system, as the > package is built with svn-buildpackage, but re-synced PO files are > not re-commited to your SVN...which is thus always outdated..:-) > > (at least, this is Thomas analysis)I need to learn more about these processes, what gets done at which phase of package building. And obviously, there is no easy document available yet. Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Denis Barbier
2005-Oct-21 22:18 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Fri, Oct 21, 2005 at 09:23:36AM +0200, Marc Haber wrote:> On Fri, Oct 21, 2005 at 08:36:10AM +0200, Christian Perrier wrote: > > (Marc pinged me on IRC about this bug report in adduser) > > Thanks for your help! > > > First of all, I think that adduser should probably make better use of > > the locales information for this Yes/No answer. > > I think that would be a good idea here. > > > I don''t have the required skills to lead you to the solution, Marc, > > but I think that Denis Barbier could. > > Thanks for directly Ccing him, I hope that he can find the time to help. > > > This fr.po file for adduser is under work now and you should soon have > > a new version anyway with these fixes among others. > > OK, I''ll wait for that before applying stuff. Better not mess with > things that I don''t understand.Hi, There is very good documentation in libc.info, section "Yes-or-No Questions", but unfortunately it is not relevant here because adduser is a perl script. So I had a look at perllocale(1), which has some nice tips, in particular about I18N::Langinfo. But be warned that their example is not very valuable under GNU/Linux, because glibc introduced YESSTR/NOSTR lately and many locales do not provide them. On the other hand, they all provide YESEXPR/NOEXPR, so you can run something like: use I18N::Langinfo qw(langinfo YESEXPR); my $yesexpr = langinfo(YESEXPR()); for (;;) { &systemcall(''/usr/bin/chfn'', $new_name); # Translators: [y/N] has to be replaced by values defined in your # locale. You can see by running "locale yesexpr" which regular # expression will be checked to find positive answer. print (gtx("Is the information correct? [y/N] ")); chop ($answer=<STDIN>); last if ($answer =~ m/$yesexpr/o); } Of course this comment may be improved ;) You need to call xgettext with the -c flag so that comments are inserted into PO files. Other minor i18n problems with your package: * the gtx() function is useless and confuses xgettext * Some msgid are concatenated to build a full sentence. This is bad. and in this case only the first part was present in PO files. Here is a patch. I tested it, but of course it may introduce bugs, please review it carefully ;) Denis -------------- next part -------------- diff -ur adduser-3.74.orig/AdduserCommon.pm adduser-3.74/AdduserCommon.pm --- adduser-3.74.orig/AdduserCommon.pm 2005-10-18 16:20:00.000000000 +0200 +++ adduser-3.74/AdduserCommon.pm 2005-10-21 23:49:30.000000000 +0200 @@ -10,7 +10,7 @@ # Ian A. Murdock <imurdock@gnu.ai.mit.edu> # -@EXPORT = qw(invalidate_nscd gtx dief warnf read_config get_users_groups get_group_members s_print s_printf systemcall); +@EXPORT = qw(invalidate_nscd dief warnf read_config get_users_groups get_group_members s_print s_printf systemcall); sub invalidate_nscd { # Check if we need to do make -C /var/yp for NIS @@ -56,10 +56,6 @@ } } -sub gtx { - return gettext( join "", @_); -} - sub dief { my ($form,@argu)=@_; printf STDERR "$0: $form",@argu; @@ -80,7 +76,7 @@ my ($var, $lcvar, $val); if (! -f $conf_file) { - printf gtx("%s: `%s'' doesn''t exist. Using defaults.\n"),$0,$conf_file if $verbose; + printf gettext("%s: `%s'' doesn''t exist. Using defaults.\n"),$0,$conf_file if $verbose; return; } @@ -90,12 +86,12 @@ next if /^#/ || /^\s*$/; if ((($var, $val) = /^\s*(\S+)\s*=\s*(.*)/) != 2) { - warnf gtx("Couldn''t parse `%s'':%s.\n"),$conf_file,$.; + warnf gettext("Couldn''t parse `%s'':%s.\n"),$conf_file,$.; next; } $lcvar = lc $var; if (!defined($configref->{$lcvar})) { - warnf gtx("Unknown variable `%s'' at `%s'':%s.\n"),$var,$conf_file,$.; + warnf gettext("Unknown variable `%s'' at `%s'':%s.\n"),$var,$conf_file,$.; next; } diff -ur adduser-3.74.orig/adduser adduser-3.74/adduser --- adduser-3.74.orig/adduser 2005-10-19 15:09:09.000000000 +0200 +++ adduser-3.74/adduser 2005-10-21 23:45:02.000000000 +0200 @@ -48,10 +48,19 @@ if ($@) { *setlocale = sub { return 1 }; } + eval { + require I18N::Langinfo; + import I18N::Langinfo qw(langinfo YESEXPR); + }; + if ($@) { + *langinfo = sub { "^[yY]" }; + *YESEXPR = sub { 1 }; + } } setlocale(LC_MESSAGES, ""); textdomain("adduser"); +my $yesexpr = langinfo(YESEXPR()); our $verbose = 1; # should we be verbose? my $allow_badname = 0; # should we allow bad names? @@ -86,7 +95,7 @@ "debug" => \$debugging ); # everyone can issue "--help" and "--version", but only root can go on -die ("$0: ",gtx("Only root may add a user or group to the system.\n")) if ($> != 0); +die ("$0: ",gettext("Only root may add a user or group to the system.\n")) if ($> != 0); if( defined($configfile) ) { @defaults = ($configfile); } @@ -106,30 +115,30 @@ while (defined($arg = shift(@ARGV))) { if (defined($names[0]) && $arg =~ /^--/) { - die ("$0: ",gtx("No options allowed after names.\n")) + die ("$0: ",gettext("No options allowed after names.\n")) } else { # it''s a username push (@names, $arg); } } -die ("$0: ",gtx("I need a name to add.\n")) if (length($names[0]) == 0); -die ("$0: ",gtx("No more than two names.\n")) if (@names > 2); +die ("$0: ",gettext("I need a name to add.\n")) if (length($names[0]) == 0); +die ("$0: ",gettext("No more than two names.\n")) if (@names > 2); if (@names == 0) { if($found_group_opt || $action eq "addgroup" || $action eq "addsysgroup") { - print (gtx("Enter a groupname to add: ")); + print (gettext("Enter a groupname to add: ")); } else { - print (gtx("Enter a username to add: ")); + print (gettext("Enter a username to add: ")); } chomp($answer=<STDIN>); push(@names, $answer); } if (@names == 2) { # must be addusertogroup - die ("$0: ",gtx("Specify only one name in this mode.\n")) + die ("$0: ",gettext("Specify only one name in this mode.\n")) if ($action eq "addsysuser" || $found_group_opt); $action = "addusertogroup"; $existing_user = shift (@names); @@ -145,18 +154,18 @@ if ($action ne "addgroup" && defined($found_group_opt) +defined($ingroup_name) +defined($new_gid) > 1 ) { - die ("$0: ",gtx("The --group, --ingroup, and --gid options are mutually exclusive.\n")); + die ("$0: ",gettext("The --group, --ingroup, and --gid options are mutually exclusive.\n")); } if ((defined($special_home)) && ($special_home !~ m+^/+ )) { - (die "$0: ",gtx("The home dir must be an absolute path.\n")) + (die "$0: ",gettext("The home dir must be an absolute path.\n")) } if (defined($special_home) && $verbose) { - print "$0: ",gtx("Warning: The home dir you specified already exists.\n") + print "$0: ",gettext("Warning: The home dir you specified already exists.\n") if (!defined($no_create_home) && -d $special_home); - print "$0: ",gtx("Warning: The home dir you specified does not exist.\n") + print "$0: ",gettext("Warning: The home dir you specified does not exist.\n") if (defined($no_create_home) && ! -d $special_home); } @@ -217,12 +226,12 @@ if ($action eq "addsysgroup") { # Check if requested group already exists and we can exit safely if (existing_group_ok($new_name, $new_gid)) { - printf (gtx("The group `%s'' already exists as a system group. Exiting...\n"), $new_name) if $verbose; + printf (gettext("The group `%s'' already exists as a system group. Exiting...\n"), $new_name) if $verbose; exit 0; } - dief (gtx("The group `%s'' already exists and is not a system group.\n"),$new_name) + dief (gettext("The group `%s'' already exists and is not a system group.\n"),$new_name) if (defined getgrnam($new_name)); - dief (gtx("The GID `%s'' is already in use.\n"),$new_gid) + dief (gettext("The GID `%s'' is already in use.\n"),$new_gid) if (defined($new_gid) && defined(getgrgid($new_gid))); if (!defined($new_gid)) { $new_gid = &first_avail_id($config{"first_system_gid"}, @@ -230,18 +239,17 @@ &get_current_gids); if ($new_gid == -1) { - print STDERR ("$0: ",gtx("No GID is available in the range "), - $config{"first_system_gid"}, " - ", $config{"last_system_gid"}, - " (FIRST_SYS_GID - LAST_SYS_GID).\n"); - dief (gtx("The group `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No GID is available in the range %d-%d (FIRST_SYS_GID - LAST_SYS_GID).\n"),$config{"first_system_gid"},$config{"last_system_gid"}; + dief (gettext("The group `%s'' was not created.\n"),$new_name); } } - printf (gtx("Adding group `%s'' (%s)...\n"),$new_name,$new_gid) if $verbose; + printf (gettext("Adding group `%s'' (%s)...\n"),$new_name,$new_gid) if $verbose; &invalidate_nscd("group"); &systemcall(''/usr/sbin/groupadd'', ''-g'', $new_gid, $new_name); &invalidate_nscd("group"); - print (gtx("Done.\n")) if $verbose; + print (gettext("Done.\n")) if $verbose; exit 0; } @@ -250,9 +258,9 @@ ## addgroup ## ############## if ($action eq "addgroup") { - dief (gtx("The group `%s'' already exists.\n"),$new_name) + dief (gettext("The group `%s'' already exists.\n"),$new_name) if (defined getgrnam($new_name)); - dief (gtx("The GID `%s'' is already in use.\n"),$new_gid) + dief (gettext("The GID `%s'' is already in use.\n"),$new_gid) if (defined($new_gid) && defined(getgrgid($new_gid))); if (!defined($new_gid)) { $new_gid = &first_avail_id($config{"first_gid"}, @@ -260,18 +268,17 @@ &get_current_gids); if ($new_gid == -1) { - print STDERR ("$0: ",gtx("No GID is available in the range "), - $config{"first_gid"}," - ", $config{"last_gid"}, - " (FIRST_GID - LAST_GID).\n"); - dief (gtx("The group `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No GID is available in the range %d-%d (FIRST_GID - LAST_GID).\n"),$config{"first_gid"},$config{"last_gid"}; + dief (gettext("The group `%s'' was not created.\n"),$new_name); } } - printf (gtx("Adding group `%s'' (%s)...\n"),$new_name,$new_gid) if $verbose; + printf (gettext("Adding group `%s'' (%s)...\n"),$new_name,$new_gid) if $verbose; &invalidate_nscd("group"); &systemcall(''/usr/sbin/groupadd'', ''-g'', $new_gid, $new_name); &invalidate_nscd("group"); - print (gtx("Done.\n")) if $verbose; + print (gettext("Done.\n")) if $verbose; exit 0; } @@ -280,17 +287,17 @@ ## addusertogroup ## #################### if ($action eq "addusertogroup") { - dief (gtx("The user `%s'' does not exist.\n"),$existing_user) + dief (gettext("The user `%s'' does not exist.\n"),$existing_user) if (!defined getpwnam($existing_user)); - dief (gtx("The group `%s'' does not exist.\n"),$existing_group) + dief (gettext("The group `%s'' does not exist.\n"),$existing_group) if (!defined getgrnam($existing_group)); if (&user_is_member($existing_user, $existing_group)) { - printf gtx("The user `%s'' is already a member of `%s''.\n"), + printf gettext("The user `%s'' is already a member of `%s''.\n"), $existing_user,$existing_group if $verbose; exit 0; # not really an error } - printf gtx("Adding user `%s'' to group `%s''...\n"),$existing_user,$existing_group + printf gettext("Adding user `%s'' to group `%s''...\n"),$existing_user,$existing_group if $verbose; &invalidate_nscd(); # FIXME - the next line has a race condition. @@ -303,7 +310,7 @@ $existing_group); #&systemcall(''gpasswd'', ''-a'',$existing_user,$existing_group); &invalidate_nscd(); - print (gtx("Done.\n")) if $verbose; + print (gettext("Done.\n")) if $verbose; exit 0; } @@ -313,23 +320,22 @@ ################ if ($action eq "addsysuser") { if (existing_user_ok($new_name, $new_uid)) { - printf (gtx("The user `%s'' already exists as a system user. Exiting...\n"), $new_name) if $verbose; + printf (gettext("The user `%s'' already exists as a system user. Exiting...\n"), $new_name) if $verbose; exit 0; } $new_gid = $nogroup_id if (!$ingroup_name && !defined($new_gid) && !$make_group_also); check_user_group(1); - printf (gtx("Adding system user `%s''...\n"),$new_name) if $verbose; + printf (gettext("Adding system user `%s''...\n"),$new_name) if $verbose; if (!defined($new_uid) && $make_group_also) { $new_uid = &first_avail_id($config{"first_system_uid"}, $config{"last_system_uid"}, &get_current_uids, &get_current_gids); if ($new_uid == -1) { - print STDERR ("$0: ",gtx("No UID/GID pair is available in the range "), - $config{"first_system_uid"}, " - ", $config{"last_system_uid"}, - " (FIRST_SYS_UID - LAST_SYS_UID).\n"); - dief (gtx("The user `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No UID/GID pair is available in the range %d-%d (FIRST_SYS_UID - LAST_SYS_UID).\n"),$config{"first_system_uid"},$config{"last_system_uid"}; + dief (gettext("The user `%s'' was not created.\n"),$new_name); } $new_gid = $new_uid; $ingroup_name = $new_name; @@ -339,32 +345,31 @@ $config{"last_system_uid"}, &get_current_uids); if ($new_uid == -1) { - print STDERR ("$0: ",gtx("No UID is available in the range "), - $config{"first_system_uid"}," - ", $config{"last_system_uid"}, - "(FIRST_SYS_UID - LAST_SYS_UID).\n"); - dief (gtx("The user `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No UID is available in the range %d-%d (FIRST_SYS_UID - LAST_SYS_UID).\n"),$config{"first_system_uid"},$config{"last_system_uid"}; + dief (gettext("The user `%s'' was not created.\n"),$new_name); } if (defined($new_gid)) { $ingroup_name = getgrgid($new_gid); } elsif ($ingroup_name) { $new_gid = getgrnam($ingroup_name); } - else { die (gtx("Internal error")); } + else { die (gettext("Internal error")); } } else { if (defined($new_gid)) { $ingroup_name = getgrgid($new_gid); } elsif ($ingroup_name) { $new_gid = getgrnam($ingroup_name); } elsif ($make_group_also){ $new_gid=$new_uid; $ingroup_name=$new_name; } - else { die (gtx("Internal error")); } + else { die (gettext("Internal error")); } } &invalidate_nscd(); # if we reach this point, and the group does already exist, we can use it. if ($make_group_also && !getgrnam($new_name)) { - printf (gtx("Adding new group `%s'' (%s).\n"),$new_name,$new_gid) if $verbose; + printf (gettext("Adding new group `%s'' (%s).\n"),$new_name,$new_gid) if $verbose; $undogroup = $new_name; &systemcall(''/usr/sbin/groupadd'', ''-g'', $new_gid, $new_name); &invalidate_nscd("group"); } - printf gtx("Adding new user `%s'' (%s) with group `%s''.\n"),$new_name,$new_uid,$ingroup_name + printf gettext("Adding new user `%s'' (%s) with group `%s''.\n"),$new_name,$new_uid,$ingroup_name if $verbose; $home_dir = $special_home || &homedir($new_name, $ingroup_name); $shell = $special_shell || ''/bin/false''; @@ -378,7 +383,7 @@ if ($?>>8); &cleanup("$0: `/usr/bin/chage -M 99999 $new_name'' exited from signal " . ($?&255) . ". Aborting.\n"); } else { - print (gtx("chage failed with return code 15, shadow not enabled, password aging cannot be set. Continuing.\n")); + print (gettext("chage failed with return code 15, shadow not enabled, password aging cannot be set. Continuing.\n")); } } &invalidate_nscd(); @@ -404,17 +409,16 @@ check_user_group(0); $first_uid = $new_firstuid || $config{"first_uid"}; $last_uid = $new_lastuid || $config{"last_uid"}; - printf (gtx("Adding user `%s''...\n"),$new_name) if $verbose; + printf (gettext("Adding user `%s''...\n"),$new_name) if $verbose; if (!defined($new_uid) && $make_group_also) { $new_uid = &first_avail_id($first_uid, $last_uid, &get_current_uids, &get_current_gids); if ($new_uid == -1) { - print STDERR ("$0: ",gtx("No UID/GID pair is available in the range "), - "$first_uid - $last_uid\n", - "(FIRST_UID - LAST_UID). "); - dief (gtx("The user `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No UID/GID pair is available in the range %d-%d (FIRST_UID - LAST_UID).\n"),$first_uid,$last_uid; + dief (gettext("The user `%s'' was not created.\n"),$new_name); } $new_gid = $new_uid; $ingroup_name = $new_name; @@ -424,31 +428,30 @@ $last_uid, &get_current_uids); if ($new_uid == -1) { - print STDERR ("$0: ",gtx("No UID is available in the range "), - $config{"first_uid"}, " - ", $config{"last_uid"}, - "(FIRST_UID - LAST_UID).\n"); - dief (gtx("The user `%s'' was not created.\n"),$new_name); + print STDERR "$0: "; + printf STDERR gettext("No UID is available in the range %d-%d (FIRST_UID - LAST_UID).\n"),$config{"first_uid"},$config{"last_uid"}; + dief (gettext("The user `%s'' was not created.\n"),$new_name); } if (defined($new_gid)) { $ingroup_name = getgrgid($new_gid); } elsif ($ingroup_name) { $new_gid = getgrnam($ingroup_name); } - else { die (gtx("Internal error")); } + else { die (gettext("Internal error")); } } else { if (defined($new_gid)) { $ingroup_name = getgrgid($new_gid); } elsif ($ingroup_name) { $new_gid = getgrnam($ingroup_name); } elsif ($make_group_also){ $new_gid=$new_uid; $ingroup_name=$new_name; } - else { die (gtx("Internal error")); } + else { die (gettext("Internal error")); } } &invalidate_nscd(); if ($make_group_also) { - printf (gtx("Adding new group `%s'' (%s).\n"),$new_name,$new_gid) if $verbose; + printf (gettext("Adding new group `%s'' (%s).\n"),$new_name,$new_gid) if $verbose; $undogroup = $new_name; &systemcall(''/usr/sbin/groupadd'', ''-g'', $new_gid, $new_name); &invalidate_nscd(); } - printf gtx("Adding new user `%s'' (%s) with group `%s''.\n"),$new_name,$new_uid,$ingroup_name + printf gettext("Adding new user `%s'' (%s) with group `%s''.\n"),$new_name,$new_uid,$ingroup_name if $verbose; $home_dir = $special_home || &homedir($new_name, $ingroup_name); $shell = $special_shell || $config{"dshell"}; @@ -474,14 +477,17 @@ else { for (;;) { &systemcall(''/usr/bin/chfn'', $new_name); - print (gtx("Is the information correct? [y/N] ")); + # Translators: [y/N] has to be replaced by values defined in your + # locale. You can see by running "locale yesexpr" which regular + # expression will be checked to find positive answer. + print (gettext("Is the information correct? [y/N] ")); chop ($answer=<STDIN>); - last if ($answer eq gtx("y")); + last if ($answer =~ m/$yesexpr/o); } } if ($config{"quotauser"}) { - printf (gtx("Setting quota from `%s''.\n"),$config{quotauser}); + printf (gettext("Setting quota from `%s''.\n"),$config{quotauser}); &systemcall(''/usr/sbin/edquota'', ''-p'', $config{quotauser}, $new_name); } @@ -514,21 +520,21 @@ my ($copy_skeleton) = @_; if ($no_create_home) { - print gtx("Not creating $home_dir.\n") if $verbose; + printf gettext("Not creating %s.\n"), $home_dir if $verbose; } elsif (-e $home_dir) { - printf gtx("The home directory `%s'' already exists. Not copying from `%s''\n"), + printf gettext("The home directory `%s'' already exists. Not copying from `%s''\n"), $home_dir,$config{skel} if $verbose && !$no_create_home; my @homedir_stat = stat($home_dir); my $home_uid = $homedir_stat[4]; my $home_gid = $homedir_stat[5]; if (($home_uid != $new_uid) || ($home_gid != $new_gid)) { - warnf gtx("Warning: that home directory does not belong to user you''re just creating\n"); + warnf gettext("Warning: that home directory does not belong to user you''re just creating\n"); } undef @homedir_stat; undef $home_uid; undef $home_gid; } else { - printf gtx("Creating home directory `%s''.\n"),$home_dir if $verbose; + printf gettext("Creating home directory `%s''.\n"),$home_dir if $verbose; $undohome = $home_dir; &mktree($home_dir) || &cleanup("Couldn''t create $home_dir: $!.\n"); chown($new_uid, $new_gid, $home_dir) @@ -538,7 +544,7 @@ &cleanup("chmod $dir_mode $home_dir: $!\n"); if ($config{"skel"} && $copy_skeleton) { - printf gtx("Copying files from `%s''\n"),$config{skel} if $verbose; + printf gettext("Copying files from `%s''\n"),$config{skel} if $verbose; open(FIND, "cd $config{skel}; find . ! -name ''*.dpkg-*'' -print |") || &cleanup("fork for find: $!\n"); while (<FIND>) { @@ -613,26 +619,26 @@ if( !$system || !existing_user_ok($new_name, $new_uid) ) { if( defined getpwnam($new_name) ) { if( $system ) { - dief (gtx("The user `%s'' already exists, and is not a system user.\n"),$new_name); + dief (gettext("The user `%s'' already exists, and is not a system user.\n"),$new_name); } else { - dief (gtx("The user `%s'' already exists.\n"),$new_name); + dief (gettext("The user `%s'' already exists.\n"),$new_name); } } - dief (gtx("The UID %s is already in use.\n"),$new_uid) + dief (gettext("The UID %s is already in use.\n"),$new_uid) if (defined($new_uid) && getpwuid($new_uid)); } if ($make_group_also) { if( !$system || !existing_group_ok($new_name, $new_uid) ) { - dief (gtx("The group `%s'' already exists.\n"),$new_name) + dief (gettext("The group `%s'' already exists.\n"),$new_name) if (defined getgrnam($new_name)); - dief (gtx("The GID %s is already in use.\n"),$new_uid) + dief (gettext("The GID %s is already in use.\n"),$new_uid) if (defined($new_uid) && defined(getgrgid($new_uid))); } } else { - dief (gtx("The group `%s'' does not exist.\n"),$ingroup_name) + dief (gettext("The group `%s'' does not exist.\n"),$ingroup_name) if ($ingroup_name && !defined(getgrnam($ingroup_name))); - dief (gtx("The GID %s does not exist.\n"),$new_gid) + dief (gettext("The GID %s does not exist.\n"),$new_gid) if (defined($new_gid) && !defined(getgrgid($new_gid))); } } @@ -688,18 +694,18 @@ my ($name) = @_; if ($name !~ /^[-_\.A-Za-z0-9]*\$?$/) { print STDERR -("$0: ",gtx("To avoid problems, the username should consist of +("$0: ",gettext("To avoid problems, the username should consist of letters, digits, underscores, periods and dashes. For compatibility with Samba machine accounts \$ is also supported at the end of the username\n")); exit 1; } if ($name !~ qr/$config{"name_regex"}/) { if ($allow_badname) { - print (gtx("Allowing use of questionable username.\n")) if ($verbose); + print (gettext("Allowing use of questionable username.\n")) if ($verbose); } else { print STDERR -("$0: ",gtx("Please enter a username matching the regular expression configured +("$0: ",gettext("Please enter a username matching the regular expression configured via the name_regex configuration variable. Use the `--force-badname'' option to relax this check or reconfigure name_regex.\n")); exit 1; @@ -714,7 +720,7 @@ sub first_avail_id { my ($min, $max, @ids) = @_; @ids = sort {$a <=> $b} @ids; - printf (gtx("Selecting from %s %s (%s).\n"),$min,$max,join(",",@ids)) if $debugging; + printf (gettext("Selecting from %s %s (%s).\n"),$min,$max,join(",",@ids)) if $debugging; while ($min <= $max) { return $min if ($min < $ids[0] || @ids==0); @@ -779,15 +785,15 @@ sub cleanup { print ("@{_}Cleaning up.\n"); if ($undohome) { - printf (gtx("Removing directory `%s''\n"),$undohome); + printf (gettext("Removing directory `%s''\n"),$undohome); system(''rm'', ''-rf'', $undohome); } if ($undouser) { - printf (gtx("Removing user `%s''.\n"),$undouser); + printf (gettext("Removing user `%s''.\n"),$undouser); system(''userdel'', $undouser); } if ($undogroup) { - printf (gtx("Removing group `%s''.\n"),$undogroup); + printf (gettext("Removing group `%s''.\n"),$undogroup); system(''groupdel'', $undogroup); } # do we need to invalidate the nscd cache here, too? @@ -819,7 +825,7 @@ } sub usage { - printf gtx( + printf gettext( "adduser [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID] [--firstuid ID] [--lastuid ID] [--gecos GECOS] [--ingroup GROUP | --gid ID] [--disabled-password] [--disabled-login] user diff -ur adduser-3.74.orig/deluser adduser-3.74/deluser --- adduser-3.74.orig/deluser 2005-10-18 16:20:00.000000000 +0200 +++ adduser-3.74/deluser 2005-10-21 23:48:55.000000000 +0200 @@ -91,7 +91,7 @@ "backup-to" => \$pconfig{"backup_to"} ); -die ("$0: ",gtx("Only root may remove a user or group from the system.\n")) if ($> != 0); +die ("$0: ",gettext("Only root may remove a user or group from the system.\n")) if ($> != 0); if (!defined($configfile)) { @defaults = ("/etc/adduser.conf", "/etc/deluser.conf"); @@ -108,7 +108,7 @@ while (defined(my $arg = shift(@ARGV))) { if (defined($names[0]) && $arg =~ /^--/) { - die ("$0: ",gtx("No options allowed after names.\n")); + die ("$0: ",gettext("No options allowed after names.\n")); } else { # it''s a username push (@names, $arg); } @@ -116,15 +116,15 @@ if(@names == 0) { if($action eq "delgroup") { - print (gtx("Enter a group name to remove: ")); + print (gettext("Enter a group name to remove: ")); } else { - print (gtx("Enter a user name to remove: ")); + print (gettext("Enter a user name to remove: ")); } chomp(my $answer=<STDIN>); push(@names, $answer); } -die ("$0: ",gtx("No name to remove given.\n")) if (length($names[0]) == 0); -die ("$0: ",gtx("No more than two names.\n")) if (@names > 2); +die ("$0: ",gettext("No name to remove given.\n")) if (length($names[0]) == 0); +die ("$0: ",gettext("No more than two names.\n")) if (@names > 2); if(@names == 2) { # must be deluserfromgroup $action = "deluserfromgroup"; @@ -157,9 +157,9 @@ undef (%pconfig); if (($config{remove_home} || $config{remove_all_files} || $config{backup}) && ($install_more_packages)) { - die (gtx("In order to use the --remove-home, --remove-all-files, and --backup features,\n - you need to install the `perl-modules'' package. To accomplish that, run\n - apt-get install perl-modules\n")); + die (gettext("In order to use the --remove-home, --remove-all-files, and --backup features, +you need to install the `perl-modules'' package. To accomplish that, run +apt-get install perl-modules\n")); } @@ -206,36 +206,36 @@ if( ($dummy1,$dummy2,$uid) = getpwnam($user) ) { if ( ($uid < $config{"first_system_uid"} || $uid > $config{"last_system_uid" } ) ) { - printf (gtx("The user `%s'' is not a system account... Exiting.\n"), $user) if $verbose; + printf (gettext("The user `%s'' is not a system account... Exiting.\n"), $user) if $verbose; exit 0; } } else { - printf (gtx("The user `%s'' does not exist, but --system was given... Exiting.\n"), $user) if $verbose; + printf (gettext("The user `%s'' does not exist, but --system was given... Exiting.\n"), $user) if $verbose; exit 0; } } unless(exist_user($user)) { - dief (gtx("The user `%s'' does not exist.\n"),$user); + dief (gettext("The user `%s'' does not exist.\n"),$user); } if($config{"remove_home"} && $config{"home"} && ($config{"home"} ne "") && ($config{"home"} ne $pw_homedir)) { - dief (gtx("passwd home dir `%s'' does not match command line home dir, aborting.\n"), + dief (gettext("passwd home dir `%s'' does not match command line home dir, aborting.\n"), $pw_homedir,$config{"home"}); } if($config{"remove_home"} || $config{"remove_all_files"}) { - s_print (gtx("Looking for files to backup/remove...\n")); + s_print (gettext("Looking for files to backup/remove...\n")); my @mountpoints; open(MOUNT, "mount |") - || die (gtx("fork for parse mount points failed: %s\n", $!)); + || die (gettext("fork for parse mount points failed: %s\n", $!)); while (<MOUNT>) { chomp; my @temparray = split; push @mountpoints,$temparray[2]; } - close(MOUNT) or die (gtx("can''t close mount pipe: %s\n",$!)); + close(MOUNT) or die (gettext("can''t close mount pipe: %s\n",$!)); my(@files,@dirs); if($config{"remove_home"} && ! $config{"remove_all_files"}) { @@ -243,14 +243,14 @@ # according to the manpage foreach my $mount (@mountpoints) { if( $File::Find::name eq $mount ) { - s_printf (gtx("Not backing up/removing `%s'', it is a mount point.\n"),$File::Find::name); + s_printf (gettext("Not backing up/removing `%s'', it is a mount point.\n"),$File::Find::name); $File::Find::prune=1; return; } } foreach my $re ( split '' '', $config{"no_del_paths"} ) { if( $File::Find::name =~ qr/$re/ ) { - s_printf (gtx("Not backing up/removing `%s'', it matches %s.\n"),$File::Find::name,$re); + s_printf (gettext("Not backing up/removing `%s'', it matches %s.\n"),$File::Find::name,$re); $File::Find::prune=1; return; } @@ -282,7 +282,7 @@ } if($config{"backup"}) { - s_print (gtx("Backing up files to be removed to ". $config{"backup_to"}. " ...\n")); + s_print (gettext("Backing up files to be removed to ". $config{"backup_to"}. " ...\n")); my $filesfile = new File::Temp(TEMPLATE=>"deluser.XXXXX", DIR=>"/tmp"); my $filesfilename = $filesfile->filename; print $filesfile join("\n",@files); @@ -297,7 +297,7 @@ } if(@files || @dirs) { - s_print (gtx("Removing files...\n")); + s_print (gettext("Removing files...\n")); unlink(@files) if(@files); foreach(reverse(sort(@dirs))) { rmdir($_); @@ -305,14 +305,14 @@ } } - s_printf (gtx("Removing user `%s''...\n"),$user); + s_printf (gettext("Removing user `%s''...\n"),$user); systemcall("/usr/sbin/userdel", $user); &invalidate_nscd(); systemcall(''/usr/local/sbin/deluser.local'', $user, $pw_uid, $pw_gid, $pw_homedir) if (-x "/usr/local/sbin/deluser.local"); - s_print (gtx("done.\n")); + s_print (gettext("done.\n")); exit 0; } @@ -320,34 +320,34 @@ if($action eq "delgroup") { &invalidate_nscd(); unless(exist_group($group)) { - dief (gtx("The group `%s'' does not exist.\n"),$group); + dief (gettext("The group `%s'' does not exist.\n"),$group); } my($dummy,$gid,$members); if( !(($dummy, $dummy, $gid, $members ) = getgrnam($group)) ) { - dief (gtx("getgrnam `%s'' failed. This shouldn''t happen.\n"), $group); + dief (gettext("getgrnam `%s'' failed. This shouldn''t happen.\n"), $group); } if( $config{"system"} && ($gid < $config{"first_system_gid"} || $gid > $config{"last_system_gid" } )) { - printf (gtx("The group `%s'' is not a system group... Exiting.\n"), $group) if $verbose; + printf (gettext("The group `%s'' is not a system group... Exiting.\n"), $group) if $verbose; exit 0; } if( $config{"only_if_empty"} && $members ne "") { - dief (gtx("The group `%s'' is not empty!\n"),$group); + dief (gettext("The group `%s'' is not empty!\n"),$group); } setpwent; while ((my $acctname,my $primgrp) = (getpwent)[0,3]) { if( $primgrp eq $gr_gid ) { - dief (gtx("`%s'' still has `%s'' as their primary group!\n"),$acctname,$group); + dief (gettext("`%s'' still has `%s'' as their primary group!\n"),$acctname,$group); } } endpwent; - s_printf (gtx("Removing group `%s''...\n"),$group); + s_printf (gettext("Removing group `%s''...\n"),$group); systemcall("/usr/sbin/groupdel",$group); &invalidate_nscd(); - s_print (gtx("done.\n")); + s_print (gettext("done.\n")); exit 0; } @@ -356,13 +356,13 @@ { &invalidate_nscd(); unless(exist_user($user)) { - dief (gtx("The user `%s'' does not exist.\n"),$user); + dief (gettext("The user `%s'' does not exist.\n"),$user); } unless(exist_group($group)) { - dief (gtx("The group `%s'' does not exist.\n"),$group); + dief (gettext("The group `%s'' does not exist.\n"),$group); } if($maingroup eq $group) { - die ("$0: ",gtx("You may not remove the user from his/her primary group.\n")); + die ("$0: ",gettext("You may not remove the user from his/her primary group.\n")); } my @members = get_group_members($group); @@ -376,29 +376,29 @@ } unless($ismember) { - dief (gtx("The user `%s'' is not a member of group `%s''.\n"),$user,$group); + dief (gettext("The user `%s'' is not a member of group `%s''.\n"),$user,$group); } - s_printf (gtx("Removing user `%s'' from group `%s''...\n"),$user,$group); + s_printf (gettext("Removing user `%s'' from group `%s''...\n"),$user,$group); #systemcall("usermod","-G", join(",",@groups), $user ); systemcall(''/usr/bin/gpasswd'',''-M'', join('','',@members), $group); &invalidate_nscd(); - s_print (gtx("done.\n")); + s_print (gettext("done.\n")); } ###### sub version { - printf (gtx("deluser: (version: %s)\n\n", $version)); - printf (gtx("removing user and groups from the system. ")); + printf (gettext("deluser: (version: %s)\n\n", $version)); + printf (gettext("removing user and groups from the system. ")); - printf gtx("Copyright (C) 2000 Roland Bauerschmidt <roland\@copyleft.de>\n\n"); + printf gettext("Copyright (C) 2000 Roland Bauerschmidt <roland\@copyleft.de>\n\n"); - printf gtx("deluser is based on adduser by Guy Maor <maor\@debian.org>, Ian Murdock\n", + printf gettext("deluser is based on adduser by Guy Maor <maor\@debian.org>, Ian Murdock\n", "<imurdock\@gnu.ai.mit.edu> and Ted Hajek <tedhajek\@boombox.micro.umn.edu>\n"); - printf gtx("\nThis program is free software; you can redistribute it and/or modify + printf gettext("\nThis program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -410,10 +410,10 @@ } sub usage { - printf (gtx("deluser: (version %s)\n\n", $version)); - printf gtx("removing user and groups from the system. Version:"); + printf (gettext("deluser: (version %s)\n\n", $version)); + printf gettext("removing user and groups from the system. Version:"); - printf gtx("deluser user + printf gettext("deluser user remove a normal user from the system example: deluser mike diff -ur adduser-3.74.orig/po/Makefile adduser-3.74/po/Makefile --- adduser-3.74.orig/po/Makefile 2005-10-04 14:27:49.000000000 +0200 +++ adduser-3.74/po/Makefile 2005-10-21 23:24:01.000000000 +0200 @@ -21,7 +21,7 @@ done; adduser.pot: ../adduser ../deluser ../AdduserCommon.pm - $(XGETTEXT) -L Perl -k_ -o $@ $? + $(XGETTEXT) -L Perl -c -o $@ $? install: all for i in $(MO) ; do \
Marc Haber
2005-Oct-22 19:03 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Sat, Oct 22, 2005 at 12:02:43AM +0200, Denis Barbier wrote:> There is very good documentation in libc.info, section "Yes-or-No Questions", > but unfortunately it is not relevant here because adduser is a perl script. > So I had a look at perllocale(1), which has some nice tips, in particular > about I18N::Langinfo. But be warned that their example is not very > valuable under GNU/Linux, because glibc introduced YESSTR/NOSTR lately > and many locales do not provide them. On the other hand, they all > provide YESEXPR/NOEXPR, so you can run something like: > use I18N::Langinfo qw(langinfo YESEXPR); > my $yesexpr = langinfo(YESEXPR()); > for (;;) { > &systemcall(''/usr/bin/chfn'', $new_name); > # Translators: [y/N] has to be replaced by values defined in your > # locale. You can see by running "locale yesexpr" which regular > # expression will be checked to find positive answer. > print (gtx("Is the information correct? [y/N] ")); > chop ($answer=<STDIN>); > last if ($answer =~ m/$yesexpr/o); > }Applied, thanks.> Of course this comment may be improved ;) > You need to call xgettext with the -c flag so that comments are inserted > into PO files.that would be XGETTEXT = xgettext -c in po/Makefile, right? Done.> Other minor i18n problems with your package: > * the gtx() function is useless and confuses xgettextgtx was named _ previously and is obviously modeled after the _ macro suggested in the gettext texinfo documentation. I''d like to keep it to be able to disable i18n for testing and debugging purposes. Unfortunately, it cannot be named _ as File::Find starts to behave very strangely when a function called _ is in the namespace. Is it possible to overload gettext with a no-op for testing purposes? If so, your changes are acceptable. I''d like to have gettext in a state where it can be disabled. Can''t xgettexts confusion be remedied by replacing -k_ with -kgtx in the Makefile? I have tried this in the lastest upload to experimental, please verify.> Here is a patch. I tested it, but of course it may introduce bugs, > please review it carefully ;)I applied the changes, but left gtx intact. Please reconsider this suggestion.> s_print (gtx("Backing up files to be removed to ". $config{"backup_to"}. " ...\n"));Doesn''t this cause translation pain as well? I have changed it to s_printf (gtx("Backing up files to be removed to %s ...\n"),$config{"backup_to"}); -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Denis Barbier
2005-Oct-24 22:03 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Sat, Oct 22, 2005 at 09:02:28PM +0200, Marc Haber wrote:> > Of course this comment may be improved ;) > > You need to call xgettext with the -c flag so that comments are > > inserted > > into PO files. > > that would be XGETTEXT = xgettext -c in po/Makefile, right? Done.Hmmm, I prefer adding -c after $(XGETTEXT). There is another glitch with po/Makefile: adduser-3.76/po$ touch ../adduser adduser-3.76/po$ make adduser.pot xgettext -c -L Perl -kgtx -o adduser.pot ../adduser Strings from deluser are then discarded. Patch attached.> > Other minor i18n problems with your package: > > * the gtx() function is useless and confuses xgettext > > gtx was named _ previously and is obviously modeled after the _ macro > suggested in the gettext texinfo documentation. I''d like to keep it to > be able to disable i18n for testing and debugging purposes. > Unfortunately, it cannot be named _ as File::Find starts to behave > very strangely when a function called _ is in the namespace. > > Is it possible to overload gettext with a no-op for testing purposes? > If so, your changes are acceptable. I''d like to have gettext in a > state where it can be disabled. > > Can''t xgettexts confusion be remedied by replacing -k_ with -kgtx in > the Makefile? I have tried this in the lastest upload to experimental, > please verify.Yes, but xgettext still displays a warning. In AdduserCommon.pm, you can replace sub gtx { return gettext( join "", @_); } by sub gtx { return gettext(shift): } to remove this warning. Calling gtx with a list is wrong, because only the first string is extracted into the POT file (see the attached patch, the 2nd string from deluser is not in adduser.pot).> > Here is a patch. I tested it, but of course it may introduce bugs, > > please review it carefully ;) > > I applied the changes, but left gtx intact. Please reconsider this > suggestion.Frankly, I see no reason to keep this wrapper. If you do not want localized messages, run your scripts with LC_ALL=C.> > s_print (gtx("Backing up files to be removed to ". $config{"backup_to"}. " ...\n")); > > Doesn''t this cause translation pain as well?Absolutely, I missed this one.> I have changed it to > > s_printf (gtx("Backing up files to be removed to %s ...\n"),$config{"backup_to"});Thanks. Denis -------------- next part -------------- diff -ur adduser-3.76.old/AdduserCommon.pm adduser-3.76/AdduserCommon.pm --- adduser-3.76.old/AdduserCommon.pm 2005-10-18 16:20:00.000000000 +0200 +++ adduser-3.76/AdduserCommon.pm 2005-10-24 23:22:57.000000000 +0200 @@ -56,8 +56,8 @@ } } -sub gtx { - return gettext( join "", @_); +sub gtx ($) { + return gettext(shift); } sub dief { diff -ur adduser-3.76.old/deluser adduser-3.76/deluser --- adduser-3.76.old/deluser 2005-10-22 20:54:53.000000000 +0200 +++ adduser-3.76/deluser 2005-10-24 23:32:46.000000000 +0200 @@ -397,7 +397,7 @@ printf gtx("Copyright (C) 2000 Roland Bauerschmidt <roland\@copyleft.de>\n\n"); - printf gtx("deluser is based on adduser by Guy Maor <maor\@debian.org>, Ian Murdock\n", + printf gtx("deluser is based on adduser by Guy Maor <maor\@debian.org>, Ian Murdock\n". "<imurdock\@gnu.ai.mit.edu> and Ted Hajek <tedhajek\@boombox.micro.umn.edu>\n"); printf gtx("\nThis program is free software; you can redistribute it and/or modify diff -ur adduser-3.76.old/po/Makefile adduser-3.76/po/Makefile --- adduser-3.76.old/po/Makefile 2005-10-22 21:08:37.000000000 +0200 +++ adduser-3.76/po/Makefile 2005-10-24 23:35:29.000000000 +0200 @@ -1,4 +1,4 @@ -XGETTEXT = xgettext -c +XGETTEXT = xgettext MSGFMT = msgfmt MSGMERGE = msgmerge @@ -12,6 +12,7 @@ PO = $(wildcard *.po) LANG = $(basename $(PO)) MO = $(addsuffix .mo,$(LANG)) +SOURCES = ../adduser ../deluser ../AdduserCommon.pm all: update $(MO) update: adduser.pot @@ -20,8 +21,8 @@ $(MSGMERGE) -U $$po adduser.pot; \ done; -adduser.pot: ../adduser ../deluser ../AdduserCommon.pm - $(XGETTEXT) -L Perl -kgtx -o $@ $? +adduser.pot: $(SOURCES) + $(XGETTEXT) -c -L Perl -kgtx -o $@ $(SOURCES) install: all for i in $(MO) ; do \
Marc Haber
2005-Oct-25 05:33 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Mon, Oct 24, 2005 at 11:51:56PM +0200, Denis Barbier wrote:> On Sat, Oct 22, 2005 at 09:02:28PM +0200, Marc Haber wrote: > > > Of course this comment may be improved ;) > > > You need to call xgettext with the -c flag so that comments are > > > inserted > > > into PO files. > > > > that would be XGETTEXT = xgettext -c in po/Makefile, right? Done. > > Hmmm, I prefer adding -c after $(XGETTEXT).Changed.> There is another glitch with po/Makefile: > adduser-3.76/po$ touch ../adduser > adduser-3.76/po$ make adduser.pot > xgettext -c -L Perl -kgtx -o adduser.pot ../adduser > Strings from deluser are then discarded. Patch attached.Applied.> Yes, but xgettext still displays a warning. > In AdduserCommon.pm, you can replace > sub gtx { > return gettext( join "", @_); > } > by > sub gtx { > return gettext(shift): > } > to remove this warning. Calling gtx with a list is wrong, because > only the first string is extracted into the POT file (see the attached > patch, the 2nd string from deluser is not in adduser.pot).Applied.> > > Here is a patch. I tested it, but of course it may introduce bugs, > > > please review it carefully ;) > > > > I applied the changes, but left gtx intact. Please reconsider this > > suggestion. > > Frankly, I see no reason to keep this wrapper. If you do not want > localized messages, run your scripts with LC_ALL=C.It is consistent with the way gettext is used in C programs, and it allows gettext to be disabled completely, which might be an advantage on low memory systems. I have committed your changes and will upload 3.78 later today. Can you then please take a new look at the package? Greetings Marc -- ----------------------------------------------------------------------------- Marc Haber | "I don''t trust Computers. They | Mailadresse im Header Mannheim, Germany | lose things." Winona Ryder | Fon: *49 621 72739834 Nordisch by Nature | How to make an American Quilt | Fax: *49 621 72739835
Denis Barbier
2005-Oct-26 23:33 UTC
Bug#224301: [Adduser-devel] Bug#224301: Some thoughts about this bug report
On Tue, Oct 25, 2005 at 07:21:59AM +0200, Marc Haber wrote:> > Frankly, I see no reason to keep this wrapper. If you do not want > > localized messages, run your scripts with LC_ALL=C. > > It is consistent with the way gettext is used in C programs,I tend to disagree, but that''s really not important ;)> and it allows gettext to be disabled completely, which might be an > advantage on low memory systems.I do not know how to perform reliable memory benchmarks, but am pretty sure that disabling gettext has no noticeable impact because localized messages are not used at all with LC_ALL=C: $ strace -e open /usr/sbin/adduser --help 2>&1 > /dev/null | grep locale ... open("/usr/share/locale/fr_FR/LC_MESSAGES/adduser.mo", O_RDONLY) = -1 ENOENT (No such file or directory) open("/usr/share/locale/fr/LC_MESSAGES/adduser.mo", O_RDONLY) = 3 $ LC_ALL=C strace -e open /usr/sbin/adduser --help 2>&1 > /dev/null | grep locale $ In GNU libc, gettext() returns its argument in this case (and also when no msgstr was found), so there is no string copy. If Locale::gettext does the same (no idea whether this is true or not), gettext (with LC_ALL=C) is very similar to *gettext = sub { shift };> I have committed your changes and will upload 3.78 later today. Can > you then please take a new look at the package?Sure. At the moment it did not yet reach my mirror, will look at it later. Thanks for taking care. Denis
Stephen Gran
2007-Feb-10 13:55 UTC
[Adduser-devel] Bug#224301: adduser: Mixes German and French and gives an infinite loop...
close 224301 3.100 found 224301 3.51 notfound 224301 3.100 thanks This appears to have been fixed in 3.100. I am going to close the bug for now, but feel free to reopen it if you disagree. Thanks all, -- ----------------------------------------------------------------- | ,''''`. Stephen Gran | | : :'' : sgran@debian.org | | `. `'' Debian user, admin, and developer | | `- http://www.debian.org | ----------------------------------------------------------------- -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: Digital signature Url : http://lists.alioth.debian.org/pipermail/adduser-devel/attachments/20070210/3d703a2f/attachment-0001.pgp
Debian Bug Tracking System
2007-Feb-10 13:56 UTC
[Adduser-devel] Processed: Re: adduser: Mixes German and French and gives an infinite loop...
Processing commands for control@bugs.debian.org:> close 224301 3.100Bug#224301: misinterpreting french templates ''close'' is deprecated; see http://www.debian.org/Bugs/Developer#closing. Bug marked as fixed in version 3.100, send any further explanations to Christophe Courtois <christophe@courtois.cc>> found 224301 3.51Bug#224301: misinterpreting french templates Bug marked as found in version 3.51.> notfound 224301 3.100Bug#224301: misinterpreting french templates Bug marked as not found in version 3.100. (By the way, this Bug is currently marked as done.)> thanksStopping processing here. Please contact me if you need assistance. Debian bug tracking system administrator (administrator, Debian Bugs database)