Package: adduser
Version: 3.92
Severity: normal
Tags: patch

Hi,

here is another round of updates concerning the program output. This time, 
I've tried to unify the usage of "aborting" and "exiting". Moreover, I've 
removed the three dots after "exiting", because that's the last message, 
there's nothing more to follow, hence, no need for an ellipsis.

I've also reworded the help texts in version() and usage(), to be more 
alike.

All of this is optional, of course, and you may choose freely what to apply.

Oh, one last thing: the patch to po/Makefile looks irrelevant, but it isn't. 
Something seems to have happened to the last patch, you need to make sure 
that the target is indented with tabs, not tabs and space. Currently, the 
target adduser.pot fails and does not generate the pot file.

Regards,
Tobias

-- 
Tobias Toedter   | "I never forget a face, but in your case I'll be glad
Hamburg, Germany | to make an exception." -- Groucho Marx
Index: adduser
===================================================================
--- adduser	(revision 606)
+++ adduser	(working copy)
@@ -2,7 +2,7 @@
 
 # adduser: a utility to add users to the system
 # addgroup: a utility to add groups to the system
-my $version = "VERSION";
+my $version = "3.92";
 
 # Copyright (C) 1997, 1998, 1999 Guy Maor <[EMAIL PROTECTED]>
 # Copyright (C) 1995 Ted Hajek <[EMAIL PROTECTED]>
@@ -106,10 +106,10 @@
 our @names;
 
 # Parse options, sanity checks
-unless ( GetOptions ("quiet" => sub { $verbose = 0 },
+unless ( GetOptions ("quiet|q" => sub { $verbose = 0 },
             "force-badname" => \$allow_badname,
 	    "help|h" => sub { &usage(); exit 0 },
-	    "version" => sub { &version(); exit 0 },
+	    "version|v" => sub { &version(); exit 0 },
 	    "system" => \$found_sys_opt,
 	    "group" => \$found_group_opt,
 	    "ingroup=s" => \$ingroup_name,
@@ -126,7 +126,7 @@
 	    "no-create-home" => \$no_create_home,
             "add_extra_groups" => \$add_extra_groups,
 	    "debug" => sub { $verbose = 2 } ) ) {
-    &usage;
+    &usage();
     exit 1;
 }
 
@@ -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. Exiting ...\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;
     }
 
@@ -296,7 +296,7 @@
         }
     }
 
-    printf (gtx("Adding group `%s' (%s)...\n"),$new_name,$new_gid) if $verbose;
+    printf (gtx("Adding group `%s' (%s) ...\n"),$new_name,$new_gid) if $verbose;
     &invalidate_nscd("group");
     my $groupadd = &which('groupadd');
     &systemcall($groupadd, '-g', $new_gid, $new_name);
@@ -343,7 +343,7 @@
 ################
 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) {
@@ -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(sprintf(gtx("%s: %s' returned error code %d. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?>>8))
+	    &cleanup(sprintf(gtx("%s: `%s' returned error code %d. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?>>8))
 	      if ($?>>8);
-	    &cleanup(sprintf(gtx("%s: %s' exited from signal %s. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?&255));
+	    &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);
 	}
@@ -803,8 +803,8 @@
       else {
         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"), $0);
+via the NAME_REGEX configuration variable.  Use the `--force-badname'
+option to relax this check or reconfigure NAME_REGEX.\n"), $0);
         exit 1;
       }
     }
@@ -874,7 +874,7 @@
     my ($msg) = @_;
     printf (gtx("Stopped: %s\n"),$msg);
     if ($undohome) {
-	printf (gtx("Removing directory `%s'\n"),$undohome);
+	printf (gtx("Removing directory `%s'.\n"),$undohome);
 	&systemcall('rm', '-rf', $undohome);
     }
     if ($undouser) {
@@ -891,17 +891,22 @@
 
 sub handler {
     my($sig) = @_;
-    &cleanup("Caught a SIG$sig.\n");
+    # Translators: the variable %s is INT, QUIT, or HUP.
+    # Please do not insert a space character between SIG and %s.
+    &cleanup(sprintf(gtx("Caught a SIG%s.\n"), $sig));
 }
     
 
 sub version {
-    print "$0: add a user or group to the system.  Version VERSION
+    printf (gtx("adduser version %s\n\n"), $version);
+    print gtx("Adds a user or group to the system.
+
 Copyright (C) 1997, 1998, 1999 Guy Maor <[EMAIL PROTECTED]>
 Copyright (C) 1995 Ian Murdock <[EMAIL PROTECTED]>,
-                   Ted Hajek <[EMAIL PROTECTED]>, 
-    
-This program is free software; you can redistribute it and/or modify
+                   Ted Hajek <[EMAIL PROTECTED]>
+\n");
+    print gtx(
+"This 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.
@@ -910,7 +915,7 @@
 WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 General Public License, /usr/share/common-licenses/GPL, for more details.
-";
+");
 }
 
 sub usage {
@@ -935,9 +940,13 @@
 adduser USER GROUP
    Add an existing user to an existing group
 
-Other options are [--quiet] [--force-badname] [--help] [--version] [--conf
-FILE].
-");
+general options:
+  --quiet | -q      don't give process information to stdout
+  --force-badname   allow usernames which do not match the
+                    NAME_REGEX configuration variable
+  --help | -h       usage message
+  --version | -v    version number and copyright
+  --conf | -c FILE  use FILE as configuration file\n\n");
 }
 
 sub get_dir_mode
Index: deluser
===================================================================
--- deluser	(revision 606)
+++ deluser	(working copy)
@@ -2,7 +2,7 @@
 
 # deluser -- a utility to remove users from the system
 # delgroup -- a utilty to remove groups from the system
-my $version = "VERSION";
+my $version = "3.92";
 
 # Copyright (C) 2000 Roland Bauerschmidt <[EMAIL PROTECTED]>
 # Based on 'adduser' as pattern by
@@ -74,10 +74,10 @@
 my $configfile;
 my @defaults;
 
-GetOptions ("quiet|q" => sub {$verbose = 0; },
+unless ( GetOptions ("quiet|q" => sub {$verbose = 0; },
             "debug" => sub {$verbose = 2; },
-	    "version|v" => sub {version(); exit 0; },
-	    "help|h" => sub { usage(); exit 0;},
+	    "version|v" => sub { &version(); exit 0; },
+	    "help|h" => sub { &usage(); exit 0;},
 	    "group" => sub { $action = "delgroup";},
 	    "conf=s" => \$configfile,
 	    "system" => \$pconfig{"system"},
@@ -86,8 +86,12 @@
 	    "remove-all-files" => \$pconfig{"remove_all_files"},
 	    "backup" => \$pconfig{"backup"},
 	    "backup-to" => \$pconfig{"backup_to"}
-	  );
+	  ) ) {
+    &usage();
+    exit 1;
+}
 
+# everyone can issue "--help" and "--version", but only root can go on
 die ("$0: ",gtx("Only root may remove a user or group from the system.\n")) if ($> != 0);
 
 if (!defined($configfile)) { 
@@ -158,7 +162,7 @@
 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,
 you need to install the `perl-modules' package. To accomplish that, run
-apt-get install perl-modules\n"));
+apt-get install perl-modules.\n"));
 }
 
  
@@ -205,11 +209,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 user. 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;
 	}
     }
@@ -343,7 +347,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 "") {
@@ -377,7 +381,7 @@
 	fail (3, gtx("The group `%s' does not exist.\n"),$group);
     }
     if($maingroup eq $group) {
-	fail (7, "$0: ",gtx("You may not remove the account from its primary group.\n"));
+	fail (7, "$0: ",gtx("You may not remove the user from their primary group.\n"));
     }
 
     my @members = get_group_members($group);
@@ -413,15 +417,15 @@
 }
 
 sub version {
-    printf (gtx("deluser (version: %s)\n\n"), $version);
-    printf (gtx("Removes users and groups from the system."));
+    printf (gtx("deluser version %s\n\n"), $version);
+    printf (gtx("Removes users and groups from the system.\n"));
     
     printf gtx("Copyright (C) 2000 Roland Bauerschmidt <[EMAIL PROTECTED]>\n\n");
 
     printf gtx("deluser is based on adduser by Guy Maor <[EMAIL PROTECTED]>, Ian Murdock\n".
-	  "<[EMAIL PROTECTED]> and Ted Hajek <[EMAIL PROTECTED]>\n");
+	  "<[EMAIL PROTECTED]> and Ted Hajek <[EMAIL PROTECTED]>\n\n");
 
-    printf gtx("\nThis program is free software; you can redistribute it and/or modify
+    printf gtx("This 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.
@@ -433,10 +437,8 @@
 }
 
 sub usage {
-    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
 
Index: po/Makefile
===================================================================
--- po/Makefile	(revision 606)
+++ po/Makefile	(working copy)
@@ -22,9 +22,9 @@
 	done;
 
 adduser.pot: $(SOURCES)
-       $(XGETTEXT) -c -L Perl -kgtx \
-       [EMAIL PROTECTED] \
-       -o $@ $(SOURCES)
+	$(XGETTEXT) -c -L Perl -kgtx \
+	[EMAIL PROTECTED] \
+	-o $@ $(SOURCES)
 
 install: all
 	for i in $(MO) ; do \

Attachment: pgpgJJ3KMnsrQ.pgp
Description: PGP signature

Reply via email to