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

Hi,

while updating the de.po file, I've discovered yet more fixes for the 
program output. I've unified the usage of dief(), so you get the program's 
name $0 each time without the need to specify it explicitely. Moreover, 
some messages have been modified to appear more than once in the output, 
thus reducing the work for translators.

Regards,
Tobias

-- 
Tobias Toedter   | The sum of the intelligence of the world is constant.
Hamburg, Germany | The population is, of course, growing.
Index: adduser
===================================================================
--- adduser	(revision 614)
+++ adduser	(working copy)
@@ -267,7 +267,7 @@
         }
     }
 
-    printf (gtx("Adding group `%s' (%d) ...\n"),$new_name,$new_gid) if $verbose;
+    printf (gtx("Adding group `%s' (GID %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' (GID %d) ...\n"),$new_name,$new_gid) if $verbose;
     &invalidate_nscd("group");
     my $groupadd = &which('groupadd');
     &systemcall($groupadd, '-g', $new_gid, $new_name);
@@ -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 %d ...\n"),$new_name,$new_uid) if $verbose;
+    printf (gtx("Adding system user `%s' (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' (%d) ...\n"),$new_name,$new_gid) if $verbose;
+	printf (gtx("Adding new group `%s' (GID %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' (%d) with group `%s' ...\n"),$new_name,$new_uid,$ingroup_name
+    printf gtx("Adding new user `%s' (UID %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(sprintf(gtx("%s: `%s' returned error code %d. Exiting.\n"), $0, "$chage -M 99999 $new_name", $?>>8))
+	    &cleanup(sprintf(gtx("`%s' returned error code %d. Exiting.\n"), "$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' exited from signal %d. Exiting.\n"), "$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);
 	}
@@ -473,7 +473,7 @@
 	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 { dien (gtx("Internal error")); }
+	else { dief (gtx("Internal error")); }
     }
 
     &invalidate_nscd();
@@ -628,7 +628,7 @@
   else {
       printf gtx("Creating home directory `%s' ...\n"),$home_dir if $verbose;
       $undohome = $home_dir;
-      &mktree($home_dir) || &cleanup(sprintf(gtx("Couldn't create %s: %s.\n"), $home_dir, $!));
+      &mktree($home_dir) || &cleanup(sprintf(gtx("Couldn't create home directory `%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);
@@ -774,7 +774,7 @@
 	mkdir("$todir/$file", 700) || &cleanup("mkdir: $!");
     }
     else {
-	&cleanup(sprintf(gtx("Can't deal with %s.\nIt is not a dir, file, or symlink.\n"), "$fromdir/$file"));
+	&cleanup(sprintf(gtx("Cannot deal with %s.\nIt is not a dir, file, or symlink.\n"), "$fromdir/$file"));
     }
     
     chown($newu, $newg, "$todir/$file")
Index: deluser
===================================================================
--- deluser	(revision 614)
+++ deluser	(working copy)
@@ -92,7 +92,7 @@
 }
 
 # 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);
+dief (gtx("Only root may remove a user or group from the system.\n")) if ($> != 0);
 
 if (!defined($configfile)) { 
     @defaults = ("/etc/adduser.conf", "/etc/deluser.conf");
@@ -109,7 +109,7 @@
 
 while (defined(my $arg = shift(@ARGV))) {
   if (defined($names[0]) && $arg =~ /^--/) {
-      die ("$0: ",gtx("No options allowed after names.\n"));
+      dief (gtx("No options allowed after names.\n"));
     } else {			# it's a username
 	push (@names, $arg);
     }
@@ -126,7 +126,7 @@
 }
 
 if (length($names[0]) == 0 || @names > 2) {
-    die ("$0: ",gtx("Only one or two names allowed.\n"));
+    dief (gtx("Only one or two names allowed.\n"));
 }
 
 if(@names == 2) {      # must be deluserfromgroup
@@ -160,7 +160,7 @@
 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,
+    dief (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"));
 }
@@ -237,7 +237,7 @@
 	      }
 	      push @mountpoints,$temparray[2];
       }
-      close(MOUNT) or die (gtx("pipe of command `mount' could not be closed: %s\n",$!));
+      close(MOUNT) or dief (gtx("pipe of command `mount' could not be closed: %s\n",$!));
       my(@files,@dirs);
       if($config{"remove_home"} && ! $config{"remove_all_files"}) {
 
Index: AdduserCommon.pm
===================================================================
--- AdduserCommon.pm	(revision 614)
+++ AdduserCommon.pm	(working copy)
@@ -57,13 +57,13 @@
 
 sub dief {
     my ($form,@argu)[EMAIL PROTECTED];
-    printf STDERR "$0: $form",@argu;
+    printf STDERR sprintf(gtx("%s: %s"), $0, $form), @argu;
     exit 1;
 }
 
 sub warnf {
     my ($form,@argu)[EMAIL PROTECTED];
-    printf STDERR "$0: $form",@argu;
+    printf STDERR sprintf(gtx("%s: %s"), $0, $form), @argu;
 }
 
 # parse the configuration file
@@ -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;
+	warnf gtx("`%s' doesn't exist. Using defaults.\n"), $conf_file if $verbose;
 	return;
     }
 
@@ -168,7 +168,7 @@
             return "$dir/$progname";
         }
     }
-    dief(gtx("Could not find program named %s in \$PATH\n"), $progname) unless ($nonfatal);
+    dief(gtx("Could not find program named `%s' in \$PATH.\n"), $progname) unless ($nonfatal);
 }
 
 

Attachment: pgptDuH43UnAR.pgp
Description: PGP signature

Reply via email to