Package: adduser Version: 3.92 Severity: normal Tags: patch Hi,
I'm currently updating the German translation for your package, and while performing the reviewing process on our translation mailing list, we've discovered quite a few inconsistencies with regard to the program's output messages. The attached patch fixes the following issues: 1. UID/GID are not written in uppercase everywhere (uid/gid appears as well) 2. Likewise, I've replaced "user" and "group" with their uppercase equivalents in the help text for the program usage. 3. If you use three dots as an ellipsis, you need to insert a space before the first dot. Otherwise, it would indicate that a part of the previous word is missing. (e.g. "Adding group `%s' (%d) ..." instead of "Adding group `%s' (%d)...") 4. I've replaced %s with %d where applicable, to ease the understanding for translators 5. I've rephrased the error message "can't close mount pipe: %s\n" with "pipe of command `mount' could not be closed: %s\n". The former version did give us a headache, as we could not understand what the message was intended to say 6. There are some other small rewordings as well 7. I've replaced "Aborting" with "Exiting", to make the program's output more consistent. As I understand it, the result is in both cases the same, namely the termination of the program. 8. The message "Couldn't parse `%s':%s.\n" has been changed to "Couldn't parse `%s', line %d.\n", because we first thought that the second %s is the actual error message, and not the line number 9. A few output strings which were not shown with gtx() have been added now 10. I've updated your copyright statement with the current address of the FSF 11. Last, not least, I'd suggest to add your mailing list as the contact address for msgid bugs. I know that several issues could be reported with a different bug each time, but I felt that all suggestions are relatively small, so I generated a cumulative patch. If this is not appropriate, let me know, and I'll split the patch up for you. Regards, Tobias -- Tobias Toedter | Time is what keeps things from happening all at once. Hamburg, Germany |
Index: deluser
===================================================================
--- deluser (revision 600)
+++ deluser (working copy)
@@ -22,7 +22,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
####################
# See the usage subroutine for explanation about how the program can be called
@@ -205,11 +205,11 @@
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 (gtx("The user `%s' is not a system account ... Exiting.\n"), $user) if $verbose;
exit 1;
}
} else {
- printf (gtx("The user `%s' does not exist, but --system was given... Exiting.\n"), $user) if $verbose;
+ printf (gtx("The user `%s' does not exist, but --system was given ... Exiting.\n"), $user) if $verbose;
exit 0;
}
}
@@ -220,10 +220,10 @@
if($config{"remove_home"} || $config{"remove_all_files"}) {
- s_print (gtx("Looking for files to backup/remove...\n"));
+ s_print (gtx("Looking for files to backup/remove ...\n"));
my @mountpoints;
open(MOUNT, "mount |")
- || fail (4 ,gtx("fork for parse mount points failed: %s\n", $!));
+ || fail (4 ,gtx("fork for `mount' to parse mount points failed: %s\n", $!));
while (<MOUNT>) {
my @temparray = split;
my $fstype = $temparray[4];
@@ -233,7 +233,7 @@
}
push @mountpoints,$temparray[2];
}
- close(MOUNT) or die (gtx("can't close mount pipe: %s\n",$!));
+ close(MOUNT) or die (gtx("pipe of command `mount' could not be closed: %s\n",$!));
my(@files,@dirs);
if($config{"remove_home"} && ! $config{"remove_all_files"}) {
@@ -303,7 +303,7 @@
}
if(@files || @dirs) {
- s_print (gtx("Removing files...\n"));
+ s_print (gtx("Removing files ...\n"));
unlink(@files) if(@files);
foreach(reverse(sort(@dirs))) {
rmdir($_);
@@ -318,7 +318,7 @@
s_print (gtx("Removing crontab\n"));
}
- s_printf (gtx("Removing user `%s'...\n"),$user);
+ s_printf (gtx("Removing user `%s' ...\n"),$user);
my $userdel = &which('userdel');
&systemcall($userdel, $user);
&invalidate_nscd();
@@ -326,7 +326,7 @@
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 (gtx("Done.\n"));
exit 0;
}
@@ -343,7 +343,7 @@
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 (gtx("The group `%s' is not a system group ... Exiting.\n"), $group) if $verbose;
exit 3;
}
if( $config{"only_if_empty"} && $members ne "") {
@@ -358,11 +358,11 @@
}
endpwent;
- s_printf (gtx("Removing group `%s'...\n"),$group);
+ s_printf (gtx("Removing group `%s' ...\n"),$group);
my $groupdel = &which('groupdel');
&systemcall($groupdel,$group);
&invalidate_nscd();
- s_print (gtx("done.\n"));
+ s_print (gtx("Done.\n"));
exit 0;
}
@@ -394,12 +394,12 @@
fail (6, gtx("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 (gtx("Removing user `%s' from group `%s' ...\n"),$user,$group);
#systemcall("usermod","-G", join(",",@groups), $user );
my $gpasswd = &which('gpasswd');
&systemcall($gpasswd,'-M', join(',',@members), $group);
&invalidate_nscd();
- s_print (gtx("done.\n"));
+ s_print (gtx("Done.\n"));
}
@@ -413,8 +413,8 @@
}
sub version {
- printf ("deluser: (version: %s)\n\n", $version);
- printf (gtx("removing user and groups from the system. "));
+ printf (gtx("deluser (version: %s)\n\n"), $version);
+ printf (gtx("Removes users and groups from the system."));
printf gtx("Copyright (C) 2000 Roland Bauerschmidt <[EMAIL PROTECTED]>\n\n");
@@ -433,29 +433,29 @@
}
sub usage {
- printf ("deluser: (version %s)\n\n", $version);
- printf gtx("removing user and groups from the system. Version:");
+ printf (gtx("deluser (version: %s)\n\n"), $version);
+ printf gtx("Removes users and groups from the system.");
- printf gtx("deluser user
+ printf gtx("deluser USER
remove a normal user from the system
example: deluser mike
--remove-home remove the users home directory and mail spool
--remove-all-files remove all files owned by user
- --backup backup files before removing.
- --backup-to <dir> target directory for the backups.
+ --backup backup files before removing.
+ --backup-to <DIR> target directory for the backups.
Default is the current directory.
--system only remove if system user
-delgroup group
-deluser --group group
+delgroup GROUP
+deluser --group GROUP
remove a group from the system
example: deluser --group students
--system only remove if system group
--only-if-empty only remove if no members left
-deluser user group
+deluser USER GROUP
remove the user from a group
example: deluser mike students
Index: adduser
===================================================================
--- adduser (revision 600)
+++ adduser (working copy)
@@ -23,7 +23,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
#
####################
@@ -244,11 +244,11 @@
if ($action eq "addsysgroup") {
# Check if requested group already exists and we can exit safely
if (existing_group_ok($new_name, $new_gid) == 1) {
- printf (gtx("The group `%s' already exists as a system group. Exiting...\n"), $new_name) if $verbose;
+ printf (gtx("The group `%s' already exists as a system group. Exiting ...\n"), $new_name) if $verbose;
exit 0;
}
if (existing_group_ok($new_name, $new_gid) == 2) {
- printf (gtx("The group `%s' already exists, but has a different gid, aborting...\n"), $new_name) if $verbose;
+ printf (gtx("The group `%s' already exists, but has a different gid, exiting ...\n"), $new_name) if $verbose;
exit 1;
}
@@ -267,7 +267,7 @@
}
}
- printf (gtx("Adding group `%s' (%s)...\n"),$new_name,$new_gid) if $verbose;
+ printf (gtx("Adding group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;
&invalidate_nscd("group");
my $groupadd = &which('groupadd');
&systemcall($groupadd, '-g', $new_gid, $new_name);
@@ -296,7 +296,7 @@
}
}
- printf (gtx("Adding group `%s' (%s)...\n"),$new_name,$new_gid) if $verbose;
+ printf (gtx("Adding group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;
&invalidate_nscd("group");
my $groupadd = &which('groupadd');
&systemcall($groupadd, '-g', $new_gid, $new_name);
@@ -320,7 +320,7 @@
exit 0; # not really an error
}
- printf gtx("Adding user `%s' to group `%s'...\n"),$existing_user,$existing_group
+ printf gtx("Adding user `%s' to group `%s' ...\n"),$existing_user,$existing_group
if $verbose;
&invalidate_nscd();
# FIXME - the next line has a race condition.
@@ -343,11 +343,11 @@
################
if ($action eq "addsysuser") {
if (existing_user_ok($new_name, $new_uid) == 1) {
- printf (gtx("The user `%s' already exists as a system user. Exiting...\n"), $new_name) if $verbose;
+ printf (gtx("The user `%s' already exists as a system user. Exiting ...\n"), $new_name) if $verbose;
exit 0;
}
if (existing_user_ok($new_name, $new_uid) == 2) {
- printf (gtx("The user `%s' already exists with a different uid. Aborting\n"), $new_name) if $verbose;
+ printf (gtx("The user `%s' already exists with a different UID. Exiting.\n"), $new_name) if $verbose;
exit 1;
}
@@ -386,19 +386,19 @@
elsif ($make_group_also){ $new_gid=$new_uid; $ingroup_name=$new_name; }
else { dief (gtx("Internal error")); }
}
- printf (gtx("Adding system user `%s' with uid %s...\n"),$new_name,$new_uid) if $verbose;
+ printf (gtx("Adding system user `%s' with UID %d ...\n"),$new_name,$new_uid) if $verbose;
&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 (gtx("Adding new group `%s' (%d).\n"),$new_name,$new_gid) if $verbose;
$undogroup = $new_name;
my $groupadd = &which('groupadd');
&systemcall($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 gtx("Adding new user `%s' (%d) 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';
@@ -412,9 +412,9 @@
# non-zero exit code and we need to do special handling here!
if (system($chage, '-M', '99999', $new_name)) {
if( ($?>>8) ne 15 ) {
- &cleanup("$0: `$chage -M 99999 $new_name' returned error code " . ($?>>8) . ". Aborting.\n")
+ &cleanup(sprintf(gtx("%s: `%s' returned error code %d. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?>>8))
if ($?>>8);
- &cleanup("$0: `$chage -M 99999 $new_name' exited from signal " . ($?&255) . ". Aborting.\n");
+ &cleanup(sprintf(gtx("%s: `%s' exited from signal %s. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?&255));
} else {
printf (gtx("%s failed with return code 15, shadow not enabled, password aging cannot be set. Continuing.\n"), $chage);
}
@@ -442,7 +442,7 @@
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 (gtx("Adding user `%s' ...\n"),$new_name) if $verbose;
if (!defined($new_uid) && $make_group_also) {
$new_uid = &first_avail_uid($first_uid,
@@ -478,14 +478,14 @@
&invalidate_nscd();
if ($make_group_also) {
- printf (gtx("Adding new group `%s' (%s).\n"),$new_name,$new_gid) if $verbose;
+ printf (gtx("Adding new group `%s' (%d).\n"),$new_name,$new_gid) if $verbose;
$undogroup = $new_name;
my $groupadd = &which('groupadd');
&systemcall($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 gtx("Adding new user `%s' (%d) 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"};
@@ -516,10 +516,10 @@
print (gtx("passwd file busy, try again\n")) if ($ok == 4);
print (gtx("invalid argument to option\n")) if ($ok == 5);
- # Translators: [y/N] has to be replaced by values defined in your
+ # Translators: [Y/n] has to be replaced by values defined in your
# locale. You can see by running "locale noexpr" which regular
# expression will be checked to find positive answer.
- print (gtx("Try again(Y/n)?"));
+ print (gtx("Try again? [Y/n] "));
chop ($answer=<STDIN>);
last if ($answer =~ m/$noexpr/o);
}
@@ -565,7 +565,7 @@
}
- printf gtx("Adding user `%s' to group `%s'...\n"),$new_name,$newgrp
+ printf gtx("Adding user `%s' to group `%s' ...\n"),$new_name,$newgrp
if $verbose;
&invalidate_nscd();
my $gpasswd = &which('gpasswd');
@@ -578,7 +578,7 @@
if ($config{"quotauser"}) {
- printf (gtx("Setting quota from `%s'.\n"),$config{quotauser});
+ printf (gtx("Setting quota for user `%s' to values of user `%s'.\n"), $new_name, $config{quotauser});
my $edquota = &which('edquota');
&systemcall($edquota, '-p', $config{quotauser}, $new_name);
}
@@ -615,20 +615,20 @@
printf gtx("Not creating home directory `%s'.\n"), $home_dir if $verbose;
}
elsif (-e $home_dir) {
- printf gtx("The home directory `%s' already exists. Not copying from `%s'\n"),
+ printf gtx("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 the user you are currently creating\n");
+ warnf gtx("Warning: that home directory does not belong to the user you are currently creating.\n");
}
undef @homedir_stat; undef $home_uid; undef $home_gid;
}
else {
printf gtx("Creating home directory `%s'.\n"),$home_dir if $verbose;
$undohome = $home_dir;
- &mktree($home_dir) || &cleanup("Couldn't create $home_dir: $!.\n");
+ &mktree($home_dir) || &cleanup(sprintf(gtx("Couldn't create %s: %s.\n"), $home_dir, $!));
chown($new_uid, $new_gid, $home_dir)
|| &cleanup("chown $new_uid:$new_gid $home_dir: $!\n");
$dir_mode = get_dir_mode($make_group_also);
@@ -638,7 +638,7 @@
if ($config{"skel"} && $copy_skeleton) {
printf gtx("Copying files from `%s'\n"),$config{skel} if $verbose;
open(FIND, "cd $config{skel}; find . -print |")
- || &cleanup("fork for find: $!\n");
+ || &cleanup(sprintf(gtx("fork for `find' failed: %s\n"), $!));
while (<FIND>) {
chop;
next if ($_ eq ".");
@@ -722,21 +722,21 @@
dief (gtx("The user `%s' already exists.\n"),$new_name);
}
}
- dief (gtx("The UID %s is already in use.\n"),$new_uid)
+ dief (gtx("The UID %d 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)
if (defined getgrnam($new_name));
- dief (gtx("The GID %s is already in use.\n"),$new_uid)
+ dief (gtx("The GID %d 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)
if ($ingroup_name && !defined(getgrnam($ingroup_name)));
- dief (gtx("The GID %s does not exist.\n"),$new_gid)
+ dief (gtx("The GID %d does not exist.\n"),$new_gid)
if (defined($new_gid) && !defined(getgrgid($new_gid)));
}
}
@@ -774,8 +774,7 @@
mkdir("$todir/$file", 700) || &cleanup("mkdir: $!");
}
else {
- &cleanup("Can't deal with $fromdir/$file. "
- ."Not a dir, file, or symlink.\n");
+ &cleanup(sprintf(gtx("Can't deal with %s.\nIt is not a dir, file, or symlink.\n"), "$fromdir/$file"));
}
chown($newu, $newg, "$todir/$file")
@@ -790,11 +789,11 @@
sub checkname {
my ($name) = @_;
if ($name !~ /^[_.A-Za-z0-9][-_.A-Za-z0-9]*\$?$/) {
- print STDERR
-("$0: " . gtx("To avoid problems, the username should consist of
+ printf STDERR
+(gtx("%s: To avoid problems, the username should consist only of
letters, digits, underscores, periods and dashes, and not start with a
dash (as defined by IEEE Std 1003.1-2001). For compatibility with Samba
-machine accounts \$ is also supported at the end of the username\n"));
+machine accounts \$ is also supported at the end of the username\n"), $0);
exit 1;
}
if ($name !~ qr/$config{"name_regex"}/) {
@@ -802,10 +801,10 @@
print (gtx("Allowing use of questionable username.\n")) if ($verbose);
}
else {
- print STDERR
-("$0: " . gtx("Please enter a username matching the regular expression configured
+ printf STDERR
+(gtx("%s: 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"));
+option to relax this check or reconfigure name_regex.\n"), $0);
exit 1;
}
}
@@ -815,7 +814,7 @@
# return -1 if no free uid is available
sub first_avail_uid {
my ($min, $max) = @_;
- printf (gtx("Selecting uid from range %s to %s.\n"),$min,$max) if ($verbose > 1);
+ printf (gtx("Selecting UID from range %d to %d.\n"),$min,$max) if ($verbose > 1);
my $t = $min;
while ($t <= $max) {
@@ -829,7 +828,7 @@
# return -1 if no free gid is available
sub first_avail_gid {
my ($min, $max) = @_;
- printf (gtx("Selecting gid from range %s to %s.\n"),$min,$max) if ($verbose > 1);
+ printf (gtx("Selecting GID from range %d to %d.\n"),$min,$max) if ($verbose > 1);
my $t = $min;
while ($t <= $max) {
@@ -918,22 +917,22 @@
printf gtx(
"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
+[--disabled-password] [--disabled-login] USER
Add a normal user
adduser --system [--home DIR] [--shell SHELL] [--no-create-home] [--uid ID]
[--gecos GECOS] [--group | --ingroup GROUP | --gid ID] [--disabled-password]
-[--disabled-login] user
+[--disabled-login] USER
Add a system user
-adduser --group [--gid ID] group
-addgroup [--gid ID] group
+adduser --group [--gid ID] GROUP
+addgroup [--gid ID] GROUP
Add a user group
-addgroup --system [--gid ID] group
+addgroup --system [--gid ID] GROUP
Add a system group
-adduser user group
+adduser USER GROUP
Add an existing user to an existing group
Other options are [--quiet] [--force-badname] [--help] [--version] [--conf
Index: AdduserCommon.pm
===================================================================
--- AdduserCommon.pm (revision 600)
+++ AdduserCommon.pm (working copy)
@@ -75,7 +75,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 gtx("%s: `%s' doesn't exist. Using defaults.\n"),$0,$conf_file if $verbose;
return;
}
@@ -85,12 +85,12 @@
next if /^#/ || /^\s*$/;
if ((($var, $val) = /^\s*([_a-zA-Z0-9]+)\s*=\s*(.*)/) != 2) {
- warnf gtx("Couldn't parse `%s':%s.\n"),$conf_file,$.;
+ warnf gtx("Couldn't parse `%s', line %d.\n"),$conf_file,$.;
next;
}
$lcvar = lc $var;
if (!defined($configref->{$lcvar})) {
- warnf gtx("Unknown variable `%s' at `%s':%s.\n"),$var,$conf_file,$.;
+ warnf gtx("Unknown variable `%s' in `%s', line %d.\n"),$var,$conf_file,$.;
next;
}
@@ -155,9 +155,9 @@
my $c = join(' ', @_);
print ("$c\n") if $verbose==2;
if (system(@_)) {
- die ("$0: `$c' returned error code " . ($?>>8) . ". Aborting.\n")
+ dief (gtx("%s: `%s' returned error code %d. Exiting.\n"), $0, $c, $?>>8)
if ($?>>8);
- die ("$0: `$c' exited from signal " . ($?&255) . ". Aborting.\n");
+ dief (gtx("%s: `%s' exited from signal %d. Exiting.\n"), $0, $c, $?&255);
}
}
@@ -168,7 +168,7 @@
return "$dir/$progname";
}
}
- dief(gtx("No program named %s in \$PATH\n"), $progname) unless ($nonfatal);
+ dief(gtx("Could not find program named %s in \$PATH\n"), $progname) unless ($nonfatal);
}
Index: examples/adduser.local
===================================================================
--- examples/adduser.local (revision 600)
+++ examples/adduser.local (working copy)
@@ -47,7 +47,7 @@
#
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
-# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+# 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#########################################################################
Index: po/Makefile
===================================================================
--- po/Makefile (revision 600)
+++ po/Makefile (working copy)
@@ -22,7 +22,9 @@
done;
adduser.pot: $(SOURCES)
- $(XGETTEXT) -c -L Perl -kgtx -o $@ $(SOURCES)
+ $(XGETTEXT) -c -L Perl -kgtx \
+ [EMAIL PROTECTED] \
+ -o $@ $(SOURCES)
install: all
for i in $(MO) ; do \
pgpyMG3yGMwVe.pgp
Description: PGP signature

