Просмотр исходного кода

Modified some strings to be able to merge them in the .pot files.

Guillem Jover лет назад: 20
Родитель
Сommit
9cb480c217
47 измененных файлов с 9266 добавлено и 10107 удалено
  1. 31 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 2 1
      lib/dbmodify.c
  4. 2 2
      lib/fields.c
  5. 6 0
      po/ChangeLog
  6. 200 290
      po/bs.po
  7. 283 324
      po/ca.po
  8. 315 316
      po/cs.po
  9. 277 318
      po/da.po
  10. 277 318
      po/de.po
  11. 198 288
      po/dpkg.pot
  12. 277 318
      po/el.po
  13. 277 318
      po/es.po
  14. 270 276
      po/eu.po
  15. 315 316
      po/fr.po
  16. 315 316
      po/gl.po
  17. 274 316
      po/hu.po
  18. 277 318
      po/id.po
  19. 277 318
      po/it.po
  20. 277 318
      po/ja.po
  21. 277 318
      po/ko.po
  22. 277 318
      po/nb.po
  23. 233 279
      po/ne.po
  24. 277 318
      po/nl.po
  25. 277 318
      po/nn.po
  26. 264 268
      po/pl.po
  27. 277 318
      po/pt.po
  28. 277 318
      po/pt_BR.po
  29. 505 415
      po/ro.po
  30. 280 318
      po/ru.po
  31. 304 313
      po/sk.po
  32. 344 337
      po/sv.po
  33. 277 318
      po/tl.po
  34. 315 316
      po/vi.po
  35. 288 313
      po/zh_CN.po
  36. 277 318
      po/zh_TW.po
  37. 1 1
      scripts/changelog/debian.pl
  38. 15 18
      scripts/cleanup-info.pl
  39. 6 1
      scripts/controllib.pl
  40. 1 1
      scripts/dpkg-distaddfile.pl
  41. 19 8
      scripts/dpkg-divert.pl
  42. 1 1
      scripts/dpkg-source.pl
  43. 15 5
      scripts/dpkg-statoverride.pl
  44. 25 17
      scripts/install-info.pl
  45. 4 0
      scripts/po/ChangeLog
  46. 262 275
      scripts/po/dpkg-dev.pot
  47. 17 6
      scripts/update-alternatives.pl

+ 31 - 0
ChangeLog

@@ -1,3 +1,34 @@
+2006-06-21  Guillem Jover  <guillem@debian.org>
+
+	* scripts/controllib.pl (usageerr): Do not mark "%s: %s" for
+	translation.
+	* scripts/changelog/debian.pl: Remove "or argument" from the
+	"unkown option" string to merge it with other similar ones.
+	* scripts/dpkg-distaddfile.pl: Quote '%s' in the "unknown option"
+	string.
+	* scripts/dpkg-source.pl: Likewise.
+	* scripts/cleanup-info.pl (ulquit): Print the program name.
+	Change all callers to not print the program name, and modify the
+	strings to merge them with similar ones.
+	* scripts/dpkg-divert.pl: Change strings referring to command line
+	argument to use '%s' instead of such argument, thus merging them.
+	(quit): Do not mark the string for translation. Do not hardcode the
+	program name and use '$0' instead.
+	(badusage): Likewise. Make it call usage.
+	* scripts/dpkg-statoverride.pl: Likewise.
+	* scripts/update-alternatives.pl: Likewise.
+	* scripts/install-info.pl: Call quit instead of die and do not print
+	the program name. Prepend "unable to" to most of those strings to
+	merge them with similar ones. Fix other strings to merge them.
+	(ulquit): Make it call quit instead of die and do not print the
+	program name.
+	(checkpipe): Likewise.
+	(quit): New function.
+	* lib/fields.c (f_dependency): Make strings use '%s' instead of
+	hardcoded character, to merge both.
+	* lib/dbmodify.c (createimptmp): Quote and increase to 255 the
+	parameter '%.250s' to merge the string with the other ones.
+
 2006-06-18  Frank Lichtenheld  <djpig@debian.org>
 
 	* scripts/dpkg-buildpackage.sh: Fix testing

+ 1 - 0
debian/changelog

@@ -18,6 +18,7 @@ dpkg (1.13.22~) UNRELEASED; urgency=low
   * Clarify dpkg-architecture new options '-e' and '-i' in man page, add
     backward compatibility information and give some examples.
     Thanks for the initial suggestions to Junichi Uekawa. Closes: #370830
+  * Modified some strings to be able to merge them in the .pot files.
   
   [ Frank Lichtenheld ]
   * dpkg-source issued spurious warnings about fields defined with

+ 2 - 1
lib/dbmodify.c

@@ -107,7 +107,8 @@ static void createimptmp(void) {
   onerr_abort++;
   
   importanttmp= fopen(importanttmpfile,"w");
-  if (!importanttmp) ohshite(_("unable to create %.250s"),importanttmpfile);
+  if (!importanttmp)
+    ohshite(_("unable to create `%.255s'"), importanttmpfile);
   setcloexec(fileno(importanttmp),importanttmpfile);
   for (i=0; i<512; i++) fputs("#padding\n",importanttmp);
   if (ferror(importanttmp))

+ 2 - 2
lib/fields.c

@@ -411,10 +411,10 @@ void f_dependency(struct pkginfo *pigp, struct pkginfoperfile *pifp,
         while (isspace(*p)) p++;
         if (*p == '(') parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                 _("`%s' field, reference to `%.255s': "
-                                "version contains `('"),fip->name,depname);
+                                "version contains `%c'"), fip->name,depname, ')');
 	else if (*p != ')') parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                 _("`%s' field, reference to `%.255s': "
-                                "version contains ` '"),fip->name,depname);
+                                "version contains `%c'"), fip->name,depname, ' ');
         else if (*p == 0) parseerr(NULL,filename,lno, warnto,warncount,pigp,0,
                                    _("`%s' field, reference to `%.255s': "
                                    "version unterminated"),fip->name,depname);

+ 6 - 0
po/ChangeLog

@@ -1,3 +1,9 @@
+2006-06-21  Guillem Jover  <guillem@debian.org>
+
+	* dpkg.pot: Regenerated.
+	* *.po: Merged with dpkg.pot. Formerly complete translations
+	become 895t21f.
+
 2006-06-19  Robert Luberda  <robert@debian.org>
 
 	* pl.po: Updated to 936t.

Разница между файлами не показана из-за своего большого размера
+ 200 - 290
po/bs.po


Разница между файлами не показана из-за своего большого размера
+ 283 - 324
po/ca.po


Разница между файлами не показана из-за своего большого размера
+ 315 - 316
po/cs.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/da.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/de.po


Разница между файлами не показана из-за своего большого размера
+ 198 - 288
po/dpkg.pot


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/el.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/es.po


Разница между файлами не показана из-за своего большого размера
+ 270 - 276
po/eu.po


Разница между файлами не показана из-за своего большого размера
+ 315 - 316
po/fr.po


Разница между файлами не показана из-за своего большого размера
+ 315 - 316
po/gl.po


Разница между файлами не показана из-за своего большого размера
+ 274 - 316
po/hu.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/id.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/it.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/ja.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/ko.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/nb.po


Разница между файлами не показана из-за своего большого размера
+ 233 - 279
po/ne.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/nl.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/nn.po


Разница между файлами не показана из-за своего большого размера
+ 264 - 268
po/pl.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/pt.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/pt_BR.po


Разница между файлами не показана из-за своего большого размера
+ 505 - 415
po/ro.po


Разница между файлами не показана из-за своего большого размера
+ 280 - 318
po/ru.po


Разница между файлами не показана из-за своего большого размера
+ 304 - 313
po/sk.po


Разница между файлами не показана из-за своего большого размера
+ 344 - 337
po/sv.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/tl.po


Разница между файлами не показана из-за своего большого размера
+ 315 - 316
po/vi.po


Разница между файлами не показана из-за своего большого размера
+ 288 - 313
po/zh_CN.po


Разница между файлами не показана из-за своего большого размера
+ 277 - 318
po/zh_TW.po


+ 1 - 1
scripts/changelog/debian.pl

@@ -56,7 +56,7 @@ while (@ARGV) {
     } elsif (m/^--version$/) {
         &version; exit(0);
     } else {
-        &usageerr(sprintf(_g("unknown option or argument \`%s'"), $_));
+        &usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }
 }
 

+ 15 - 18
scripts/cleanup-info.pl

@@ -65,7 +65,7 @@ sub ulquit {
     unlink "$infodir/dir.lock"
 	or warn sprintf(_g("%s: warning - unable to unlock %s: %s"),
 	                $name, "$infodir/dir", $!)."\n";
-    die $_[0];
+    die "$name: $_[0]";
 }
 
 while (scalar @ARGV > 0 && $ARGV[0] =~ /^--/) {
@@ -104,11 +104,9 @@ if (!link "$infodir/dir", "$infodir/dir.lock") {
                                   "$infodir/dir.lock")."\n" : '');
 }
 open OLD, "$infodir/dir"
-    or ulquit sprintf(_g("%s: can't open %s: %s"),
-                      $name, "$infodir/dir", $!)."\n";
+    or ulquit sprintf(_g("unable to open %s: %s"), "$infodir/dir", $!)."\n";
 open OUT, ">$infodir/dir.new"
-    or ulquit sprintf(_g("%s: can't create %s: %s"),
-                      $name, "$infodir/dir.new", $!)."\n";
+    or ulquit sprintf(_g("unable to create %s: %s"), "$infodir/dir.new", $!)."\n";
 
 my (%sections, @section_list, $lastline);
 my $section="Miscellaneous";	# default section
@@ -119,8 +117,8 @@ while (<OLD>) {				# dump the non entries part
     last if (/$waitfor/oi);
     if (defined $lastline) {
 	print OUT $lastline
-	    or ulquit sprintf(_g("%s: error writing %s: %s"),
-	                      $name, "$infodir/dir.new", $!)."\n";
+	    or ulquit sprintf(_g("unable to write %s: %s"),
+				 "$infodir/dir.new", $!)."\n";
     }
     $lastline = $_;
 };
@@ -159,26 +157,25 @@ foreach (<OLD>) {		# collect sections
     }
 }
 
-eof OLD or ulquit sprintf(_g("%s: read %s: %s"),
-                          $name, "$infodir/dir", $!)."\n";
-close OLD or ulquit sprintf(_g("%s: close %s after read: %s"),
-                            $name, "$infodir/dir", $!)."\n";
+eof OLD or ulquit sprintf(_g("unable to read %s: %s"), "$infodir/dir", $!)."\n";
+close OLD or ulquit sprintf(_g("unable to close %s after read: %s"),
+                               "$infodir/dir", $!)."\n";
 
 print OUT @sections{@section_list};
-close OUT or ulquit sprintf(_g("%s: error closing %s: %s"),
-                            $name, "$infodir/dir.new", $!)."\n";
+close OUT or ulquit sprintf(_g("unable to close %s: %s"),
+                               "$infodir/dir.new", $!)."\n";
 
 # install clean version
 unlink "$infodir/dir.old";
 link "$infodir/dir", "$infodir/dir.old"
-    or ulquit sprintf(_g("%s: can't backup old %s, giving up: %s"),
-                      $name, "$infodir/dir", $!)."\n";
+    or ulquit sprintf(_g("unable to backup old %s, giving up: %s"),
+                         "$infodir/dir", $!)."\n";
 rename "$infodir/dir.new", "$infodir/dir"
-    or ulquit sprintf(_g("%s: failed to install %s; I'll leave it as %s: %s"),
-                      $name, "$infodir/dir", "$infodir/dir.new", $!)."\n";
+    or ulquit sprintf(_g("failed to install %s; it will be left as %s: %s"),
+                         "$infodir/dir", "$infodir/dir.new", $!)."\n";
 
 unlink "$infodir/dir.lock"
-    or die sprintf(_g("%s: failed to unlock %s: %s"),
+    or die sprintf(_g("%s: unable to unlock %s: %s"),
                    $name, "$infodir/dir", $!)."\n";
 
 exit 0;

+ 6 - 1
scripts/controllib.pl

@@ -420,7 +420,12 @@ sub syserr { die sprintf(_g("%s: failure: %s: %s"), $progname, $_[0], $!)."\n";
 sub error { die sprintf(_g("%s: error: %s"), $progname, $_[0])."\n"; }
 sub internerr { die sprintf(_g("%s: internal error: %s"), $progname, $_[0])."\n"; }
 sub warn { if (!$quiet_warnings) { warn sprintf(_g("%s: warning: %s"), $progname, $_[0])."\n"; } }
-sub usageerr { printf(STDERR _g("%s: %s")."\n\n", $progname, "@_"); &usage; exit(2); }
+sub usageerr
+{
+    printf(STDERR "%s: %s\n\n", $progname, "@_");
+    &usage;
+    exit(2);
+}
 sub warnerror { if ($warnable_error) { &warn( @_ ); } else { &error( @_ ); } }
 
 sub subprocerr {

+ 1 - 1
scripts/dpkg-distaddfile.pl

@@ -48,7 +48,7 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
     } elsif (m/^--$/) {
         last;
     } else {
-        &usageerr(sprintf(_g("unknown option %s"), $_));
+        &usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }
 }
 

+ 19 - 8
scripts/dpkg-divert.pl

@@ -94,15 +94,15 @@ while (@ARGV) {
         &checkmanymodes;
         $mode= 'truename';
     } elsif (m/^--divert$/) {
-        @ARGV || &badusage(_g("--divert needs a divert-to argument"));
+        @ARGV || &badusage(sprintf(_g("--%s needs a divert-to argument"), "divert"));
         $divertto= shift(@ARGV);
         $divertto =~ m/\n/ && &badusage(_g("divert-to may not contain newlines"));
     } elsif (m/^--package$/) {
-        @ARGV || &badusage(_g("--package needs a package argument"));
+        @ARGV || &badusage(sprintf(_g("--%s needs a <package> argument"), "package"));
         $package= shift(@ARGV);
         $package =~ m/\n/ && &badusage(_g("package may not contain newlines"));
     } elsif (m/^--admindir$/) {
-        @ARGV || &badusage(_g("--admindir needs a directory argument"));
+        @ARGV || &badusage(sprintf(_g("--%s needs a <directory> argument"), "admindir"));
         $admindir= shift(@ARGV);
     } else {
         &badusage(sprintf(_g("unknown option \`%s'"), $_));
@@ -122,7 +122,7 @@ while(<O>) {
 close(O);
 
 if ($mode eq 'add') {
-    @ARGV == 1 || &badusage(_g("--add needs a single argument"));
+    @ARGV == 1 || &badusage(sprintf(_g("--%s needs a single argument"), "add"));
     $file= $ARGV[0];
     $file =~ m#^/# || &badusage(sprintf(_g("filename \"%s\" is not absolute"), $file));
     $file =~ m/\n/ && &badusage(_g("file may not contain newlines"));
@@ -150,7 +150,7 @@ if ($mode eq 'add') {
     &dorename($file,$divertto);
     exit(0);
 } elsif ($mode eq 'remove') {
-    @ARGV == 1 || &badusage(_g("--remove needs a single argument"));
+    @ARGV == 1 || &badusage(sprintf(_g("--%s needs a single argument"), "remove"));
     $file= $ARGV[0];
     for ($i=0; $i<=$#contest; $i++) {
         next unless $file eq $contest[$i];
@@ -192,7 +192,7 @@ if ($mode eq 'add') {
     }
     exit(0);
 } elsif ($mode eq 'truename') {
-    @ARGV == 1 || &badusage(_g("--truename needs a single argument"));
+    @ARGV == 1 || &badusage(sprintf(_g("--%s needs a single argument"), "truename"));
     $file= $ARGV[0];
     for ($i=0; $i<=$#contest; $i++) {
 	next unless $file eq $contest[$i];
@@ -275,6 +275,17 @@ sub save {
 sub infoa { &infol($file,$divertto,$package); }
 sub infon { &infol($contest[$i],$altname[$i],$package[$i]); }
 
-sub quit { printf STDERR _g("dpkg-divert: %s")."\n", "@_"; exit(2); }
-sub badusage { printf STDERR _g("dpkg-divert: %s")."\n\n", "@_"; print(_g("You need --help.")."\n"); exit(2); }
+sub quit
+{
+    printf STDERR "%s: %s\n", $0, "@_";
+    exit(2);
+}
+
+sub badusage
+{
+    printf STDERR "%s: %s\n\n", $0, "@_";
+    &usage;
+    exit(2);
+}
+
 sub badfmt { &quit(sprintf(_g("internal error: %s corrupt: %s"), "$admindir/diversions", $_[0])); }

+ 1 - 1
scripts/dpkg-source.pl

@@ -167,7 +167,7 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
     } elsif (m/^--$/) {
         last;
     } else {
-        &usageerr(sprintf(_g("unknown option %s"), $_));
+        &usageerr(sprintf(_g("unknown option \`%s'"), $_));
     }
 }
 

+ 15 - 5
scripts/dpkg-statoverride.pl

@@ -71,7 +71,7 @@ while (@ARGV) {
 	} elsif (m/^--force$/) {
 		$doforce=1;
 	} elsif (m/^--admindir$/) {
-		@ARGV || &badusage(_g("--admindir needs a directory argument"));
+		@ARGV || &badusage(sprintf(_g("--%s needs a <directory> argument"), "admindir"));
 		$admindir= shift(@ARGV);
 	} elsif (m/^--add$/) {
 		&CheckModeConflict;
@@ -121,7 +121,7 @@ if ($mode eq "add") {
 	if (defined $owner{$file}) {
 		printf STDERR _g("An override for \"%s\" already exists, "), $file;
 		if ($doforce) {
-			print STDERR _g("but --force specified so lets ignore it.")."\n";
+			print STDERR _g("but --force specified so will be ignored.")."\n";
 		} else {
 			print STDERR _g("aborting")."\n";
 			exit(3);
@@ -141,7 +141,7 @@ if ($mode eq "add") {
 	    }
 	}
 } elsif ($mode eq "remove") {
-	@ARGV==1 || &badusage(_g("--remove needs a single argument"));
+	@ARGV==1 || &badusage(sprintf(_g("--%s needs a single argument"), "remove"));
 	$file=$ARGV[0];
 	$file =~ s,/+$,, && print STDERR _g("stripping trailing /")."\n";
 	if (not defined $owner{$file}) {
@@ -213,7 +213,17 @@ sub WriteOverrides {
 }
 
 
-sub quit { printf STDERR _g("dpkg-statoverride: %s")."\n", "@_"; exit(2); }
-sub badusage { printf STDERR _g("dpkg-statoverride: %s")."\n\n", "@_"; print(_g("You need --help.")."\n"); exit(2); }
+sub quit
+{
+	printf STDERR "%s: %s\n", $0, "@_";
+	exit(2);
+}
+
+sub badusage
+{
+	printf STDERR "%s: %s\n\n", $0, "@_";
+	&usage;
+	exit(2);
+}
 
 # vi: ts=8 sw=8 ai si cindent

+ 25 - 17
scripts/install-info.pl

@@ -94,7 +94,7 @@ while ($ARGV[0] =~ m/^--/) {
         &version; exit 0;
     } elsif ($_ eq '--debug') {
 	open(DEBUG,">&STDERR")
-	    || die sprintf(_g("Could not open stderr for output! %s"), $!)."\n";
+	    || &quit(sprintf(_g("could not open stderr for output! %s"), $!));
 	$debug=1;
     } elsif ($_ eq '--section') {
         if (@ARGV < 2) {
@@ -104,7 +104,7 @@ while ($ARGV[0] =~ m/^--/) {
         $sectionre= shift(@ARGV);
         $sectiontitle= shift(@ARGV);
     } elsif (m/^--(c?align|maxwidth)=([0-9]+)$/) {
-	warn( sprintf(_g("%s: %s deprecated(ignored)"), $name, $1)."\n" );
+	warn(sprintf(_g("%s: option --%s is deprecated (ignored)"), $name, $1)."\n");
     } elsif (m/^--info-?dir=/) {
 	$dirfile = $' . '/dir';
     } elsif (m/^--info-file=/) {
@@ -162,7 +162,7 @@ if (!$remove) {
 
     if (!length($description)) {
         
-        open(IF,"$filename") || die sprintf(_g("%s: read %s: %s"), $name, $filename, $!)."\n";
+        open(IF,"$filename") || &quit(sprintf(_g("unable to read %s: %s"), $filename, $!));
         $asread='';
         while(<IF>) {
 	    m/^START-INFO-DIR-ENTRY$/ && last;
@@ -197,14 +197,14 @@ if (!$remove) {
         $infoentry =~ m/\n/;
         print "$`\n" unless $quiet;
         $infoentry =~ m/^\*\s*([^:]+):\s*\(([^\)]+)\)/ || 
-            die sprintf(_g("%s: Invalid info entry"), $name)."\n"; # internal error
+            &quit(_g("invalid info entry")); # internal error
         $sortby= $1;
         $fileinentry= $2;
 
     } else {
 
         if (!length($description)) {
-            open(IF,"$filename") || die sprintf(_g("%s: read %s: %s"), $name, $filename, $!)."\n";
+            open(IF,"$filename") || &quit(_g("unable to read %s: %s"), $filename, $!);
             $asread='';
             while(<IF>) {
                 if (m/^\s*[Tt]his file documents/) {
@@ -309,10 +309,11 @@ if (!$nowrite && !link($dirfile, "$dirfile.lock")) {
     exit 1;
 }
 
-open(OLD,$dirfile) || &ulquit(sprintf(_g("open %s: %s"), $dirfile, $!));
+open(OLD, $dirfile) || &ulquit(sprintf(_g("unable to open %s: %s"), $dirfile, $!));
 @work= <OLD>;
-eof(OLD) || &ulquit(sprintf(_g("read %s: %s"), $dirfile, $!));
-close(OLD) || &ulquit(sprintf(_g("close %s after read: %s"), $dirfile, $!));
+eof(OLD) || &ulquit(sprintf(_g("unable to read %s: %s"), $dirfile, $!));
+close(OLD) || &ulquit(sprintf(_g("unable to close %s after read: %s"),
+				 $dirfile, $!));
 
 while (($#work >= 0) && ($work[$#work] !~ m/\S/)) { $#work--; }
 
@@ -478,33 +479,40 @@ foreach ( @work ) {
 }
 
 if (!$nowrite) {
-    open(NEW,"> $dirfile.new") || &ulquit(sprintf(_g("create %s: %s"), "$dirfile.new", $!));
+    open(NEW,"> $dirfile.new") || &ulquit(sprintf(_g("unable to create %s: %s"),
+						     "$dirfile.new", $!));
     print(NEW @head,join("\n",@newwork)) ||
-	&ulquit(sprintf(_g("write %s: %s"), "$dirfile.new", $!));
-    close(NEW) || &ulquit(sprintf(_g("close %s: %s"), "$dirfile.new", $!));
+	&ulquit(sprintf(_g("unable to write %s: %s"), "$dirfile.new", $!));
+    close(NEW) || &ulquit(sprintf(_g("unable to close %s: %s"), "$dirfile.new", $!));
 
     unlink("$dirfile.old");
     link($dirfile, "$dirfile.old") ||
-	&ulquit(sprintf(_g("cannot backup old %s, giving up: %s"), $dirfile, $!));
+	&ulquit(sprintf(_g("unable to backup old %s, giving up: %s"),
+			   $dirfile, $!));
     rename("$dirfile.new", $dirfile) ||
-	&ulquit(sprintf(_g("install new %s: %s"), $dirfile, $!));
+	&ulquit(sprintf(_g("unable to install new %s: %s"), $dirfile, $!));
 
     unlink("$dirfile.lock") ||
-	die sprintf(_g("%s: unlock %s: %s"), $name, $dirfile, $!)."\n";
+	&quit(sprintf(_g("unable to unlock %s: %s"), $dirfile, $!));
     system ('cp', $dirfile, $backup) &&
-	warn sprintf(_g("%s: couldn't backup %s in %s: %s"), $name, $dirfile, $backup, $!)."\n";
+	warn sprintf(_g("%s: could not backup %s in %s: %s"), $name, $dirfile, $backup, $!)."\n";
+}
+
+sub quit
+{
+    die "$name: $@\n";
 }
 
 sub ulquit {
     unlink("$dirfile.lock") ||
 	warn sprintf(_g("%s: warning - unable to unlock %s: %s"),
 		     $name, $dirfile, $!)."\n";
-    die "$name: $_[0]\n";
+    &quit($_[0]);
 }
 
 sub checkpipe {
     return if !$pipeit || !$? || $?==0x8D00 || $?==0x0D;
-    die sprintf(_g("%s: read %s: %d"), $name, $filename, $?)."\n";
+    &quit(sprintf(_g("unable to read %s: %d"), $filename, $?));
 }
 
 sub dprint {

+ 4 - 0
scripts/po/ChangeLog

@@ -1,3 +1,7 @@
+2006-06-21  Guillem Jover  <guillem@debian.org>
+
+	* dpkg-dev.pot: Regenerated.
+
 2006-06-04  Guillem Jover  <guillem@debian.org>
 
 	* dpkg-dev.pot: Regenerated.

Разница между файлами не показана из-за своего большого размера
+ 262 - 275
scripts/po/dpkg-dev.pot


+ 17 - 6
scripts/update-alternatives.pl

@@ -83,8 +83,19 @@ Options:
   --version                show the version.
 "), $0;
 }
-sub quit {printf STDERR _g("update-alternatives: %s")."\n", "@_"; exit(2);}
-sub badusage { printf STDERR _g("update-alternatives: %s")."\n\n", "@_"; &usage; exit(2); }
+
+sub quit
+{
+    printf STDERR "%s: %s\n", $0, "@_";
+    exit(2);
+}
+
+sub badusage
+{
+    printf STDERR "%s: %s\n\n", $0, "@_";
+    &usage;
+    exit(2);
+}
 
 $altdir= '/etc/alternatives';
 $admindir= $admindir . '/alternatives';
@@ -138,10 +149,10 @@ while (@ARGV) {
         $aslavelink{$sname}= $slink;
         $aslavepath{$sname}= $spath;
     } elsif (m/^--altdir$/) {
-        @ARGV || &badusage(_g("--altdir needs a <directory> argument"));
+        @ARGV || &badusage(sprintf(_g("--%s needs a <directory> argument"), "altdir"));
         $altdir= shift(@ARGV);
     } elsif (m/^--admindir$/) {
-        @ARGV || &badusage(_g("--admindir needs a <directory> argument"));
+        @ARGV || &badusage(sprintf(_g("--%s needs a <directory> argument"), "admindir"));
         $admindir= shift(@ARGV);
     } elsif (m/^--all$/) {
         $mode = 'all';
@@ -197,7 +208,7 @@ if (open(AF,"$admindir/$name")) {
     close(AF);
     $dataread=1;
 } elsif ($! != &ENOENT) {
-    &quit(sprintf(_g("failed to open %s: %s"), "$admindir/$name", $!));
+    &quit(sprintf(_g("unable to open %s: %s"), "$admindir/$name", $!));
 }
 
 if ($mode eq 'display') {
@@ -504,7 +515,7 @@ rename_mv("$admindir/$name.dpkg-new","$admindir/$name") ||
 
 if ($manual eq 'auto') {
     rename_mv("$altdir/$name.dpkg-tmp","$altdir/$name") ||
-        &quit(sprintf(_g("unable to install %s as %s"), "$altdir/$name.dpkg-tmp", "$altdir/$name"));
+        &quit(sprintf(_g("unable to install %s as %s: %s"), "$altdir/$name.dpkg-tmp", "$altdir/$name", $!));
     for ($j=0; $j<=$#slavenames; $j++) {
         $sname= $slavenames[$j];
         $slink= $slavelinks[$j];