Przeglądaj źródła

Decapitalize error and warning messages

Guillem Jover 13 lat temu
rodzic
commit
9b8a544549

+ 1 - 0
debian/changelog

@@ -30,6 +30,7 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     Closes: #681370
   * Fix field names on error messages in libdpkg, by either capitalizing them
     or by renaming them to match reality.
+  * Do not capitalize error and warning messages.
 
   [ Updated programs translations ]
   * German (Sven Joachim).

+ 6 - 6
dselect/methods/Dselect/Ftp.pm

@@ -44,14 +44,14 @@ sub read_config {
 
   local($/);
   open(my $vars_fh, '<', $vars) ||
-    die "Couldn't open $vars : $!\n" .
+    die "couldn't open '$vars': $!\n" .
         "Try to relaunch the 'Access' step in dselect, thanks.\n";
   $code = <$vars_fh>;
   close $vars_fh;
 
   my $VAR1; ## no critic (Variables::ProhibitUnusedVariables)
   $conf = eval $code;
-  die "Couldn't eval $vars content : $@\n" if ($@);
+  die "couldn't eval $vars content: $@\n" if ($@);
   if (ref($conf) =~ /HASH/) {
     foreach (keys %{$conf}) {
       $config{$_} = $conf->{$_};
@@ -71,7 +71,7 @@ sub store_config {
   return if not $config{done};
 
   open(my $vars_fh, '>', $vars) ||
-    die "Couldn't open $vars in write mode : $!\n";
+    die "couldn't open $vars in write mode: $!\n";
   print $vars_fh Dumper(\%config);
   close $vars_fh;
 }
@@ -206,7 +206,7 @@ sub yesno($$) {
   $r = -1;
   $r = 0 if $d eq 'n';
   $r = 1 if $d eq 'y';
-  die 'Incorrect usage of yesno, stopped' if $r == -1;
+  die 'incorrect usage of yesno, stopped' if $r == -1;
   while (1) {
     print $msg, " [$d]: ";
     $res = <STDIN>;
@@ -366,13 +366,13 @@ sub do_mdtm {
 		$hours = 0; $minutes = 0;
 		$year = $year_or_time - 1900;
 	    } else {
-		die 'Cannot parse year-or-time';
+		die 'cannot parse year-or-time';
 	    }
 
 	    # build a system time
 	    $time = Time::Local::timegm(0, $minutes, $hours, $day, $month, $year);
 	} else {
-	    die 'Regexp match failed on LIST output';
+	    die 'regexp match failed on LIST output';
 	}
     }
 

+ 5 - 5
dselect/methods/ftp/install

@@ -62,13 +62,13 @@ my %md5sums;
 if (-f "$methdir/md5sums") {
   local $/;
   open(my $md5sums_fh, '<', "$methdir/md5sums") ||
-    die "Couldn't read file $methdir/md5sums";
+    die "couldn't read file $methdir/md5sums";
   my $code = <$md5sums_fh>;
   close $md5sums_fh;
   my $VAR1; ## no critic (Variables::ProhibitUnusedVariables)
   my $res = eval $code;
   if ($@) {
-    die "Couldn't eval $methdir/md5sums content: $@\n";
+    die "couldn't eval $methdir/md5sums content: $@\n";
   }
   if (ref($res)) { %md5sums = %{$res} }
 }
@@ -99,7 +99,7 @@ sub getblk {
 		    }
 		    return %flds;
 		} else {
-		    die "Expected a start of field line, but got:\n$_";
+		    die "expected a start of field line, but got:\n$_";
 		}
 	    }
 	}
@@ -157,7 +157,7 @@ sub procpkgfile {
     my $dist = shift;
     my (@files, @sizes, @md5sums, $pkg, $ver, $nfs, $fld);
     my(%flds);
-    open(my $pkgfile_fh, '<', $fn) or die "Could not open package file $fn";
+    open(my $pkgfile_fh, '<', $fn) or die "could not open package file $fn";
     while (%flds = getblk($pkgfile_fh), %flds) {
 	$pkg = $flds{'package'};
 	$ver = $curpkgs{$pkg};
@@ -625,7 +625,7 @@ foreach (keys %md5sums) {
   delete $md5sums{$_};
 }
 open(my $md5sums_fh, '>', "$methdir/md5sums") ||
-  die "Can't open $methdir/md5sums in write mode : $!\n";
+  die "can't open $methdir/md5sums in write mode: $!\n";
 print $md5sums_fh Dumper(\%md5sums);
 close $md5sums_fh;
 

+ 1 - 1
dselect/methods/ftp/setup

@@ -150,7 +150,7 @@ sub download() {
 print "\nUsing FTP to check directories...(stop with ^C)\n\n";
 eval {
     local $SIG{INT} = sub {
-	die "Interrupted!\n";
+	die "interrupted!\n";
     };
     download();
 };

+ 1 - 1
dselect/methods/ftp/update

@@ -203,7 +203,7 @@ foreach (@{$config{site}}) {
 
 eval {
     local $SIG{INT} = sub {
-	die "Interrupted!\n";
+	die "interrupted!\n";
     };
     download();
 };

+ 4 - 3
dselect/methods/multicd/install

@@ -196,7 +196,7 @@ done
 	my $STATUS = "$vardir/status";
 	my %Installed, %Filename, %Medium;
 	print "Get currently installed package versions...";
-	open(IN, "$STATUS") or die "Cannot open $STATUS: $!\n";
+	open(IN, "$STATUS") or die "cannot open $STATUS: $!\n";
 	$line = 0;
 	{ local $/ = "";
 	while (<IN>) {
@@ -263,7 +263,8 @@ done
 			print "Please change the discs and press <RETURN>\n";
 			system($umount);
 			<STDIN>;
-			system($mount); $? and warn("Cannot mount $mount\n");
+			system($mount);
+			$? and warn("cannot mount $mount\n");
 		} continue {
 			if (-r "$mountpoint/.disk/info") {
 			    open(IN, "$mountpoint/.disk/info") or die("$mountpoint/.disk/info: $!\n");
@@ -282,7 +283,7 @@ done
 			symlink "$mountpoint/$hierbase/$Filename{$_}",
 				"tmp/$basename";
 		}
-		chdir "tmp" or die "Cannot chdir to tmp: $!\n";
+		chdir "tmp" or die "cannot chdir to tmp: $!\n";
 		system "dpkg", "-iGROEB", ".";
 		unlink <*>;
 		chdir "..";

+ 1 - 1
lib/dpkg/fields.c

@@ -512,7 +512,7 @@ f_dependency(struct pkginfo *pkg, struct pkgbin *pkgbin,
         }
         if ((dop->verrel != dpkg_relation_eq) && (fip->integer == dep_provides))
           parse_warn(ps,
-                     _("Only exact versions may be used for '%s' field"),
+                     _("only exact versions may be used for '%s' field"),
                      "Provides");
 
         if (!isspace(*p) && !isalnum(*p)) {

+ 2 - 2
scripts/Dpkg/Arch.pm

@@ -93,7 +93,7 @@ my %debarch_to_debtriplet;
 	$gcc_host_gnu_type = get_gcc_host_gnu_type();
 
 	if ($gcc_host_gnu_type eq '') {
-	    warning(_g("Couldn't determine gcc system type, falling back to " .
+	    warning(_g("couldn't determine gcc system type, falling back to " .
 	               'default (native compilation)'));
 	} else {
 	    my (@host_archtriplet) = gnutriplet_to_debtriplet($gcc_host_gnu_type);
@@ -102,7 +102,7 @@ my %debarch_to_debtriplet;
 	    if (defined $host_arch) {
 		$gcc_host_gnu_type = debtriplet_to_gnutriplet(@host_archtriplet);
 	    } else {
-		warning(_g('Unknown gcc system type %s, falling back to ' .
+		warning(_g('unknown gcc system type %s, falling back to ' .
 		           'default (native compilation)'), $gcc_host_gnu_type);
 		$gcc_host_gnu_type = '';
 	    }

+ 4 - 4
scripts/Dpkg/Checksums.pm

@@ -170,7 +170,7 @@ sub add_from_file {
     push @{$self->{files}}, $key unless exists $self->{size}{$key};
     (my @s = stat($file)) || syserr(_g('cannot fstat file %s'), $file);
     if (exists $self->{size}{$key} and $self->{size}{$key} != $s[7]) {
-	error(_g('File %s has size %u instead of expected %u'),
+	error(_g('file %s has size %u instead of expected %u'),
 	      $file, $s[7], $self->{size}{$key});
     }
     $self->{size}{$key} = $s[7];
@@ -184,7 +184,7 @@ sub add_from_file {
 	    my $newsum = $1;
 	    if (exists $self->{checksums}{$key}{$alg} and
 		$self->{checksums}{$key}{$alg} ne $newsum) {
-		error(_g('File %s has checksum %s instead of expected %s (algorithm %s)'),
+		error(_g('file %s has checksum %s instead of expected %s (algorithm %s)'),
 		      $file, $newsum, $self->{checksums}{$key}{$alg}, $alg);
 	    }
 	    $self->{checksums}{$key}{$alg} = $newsum;
@@ -223,11 +223,11 @@ sub add_from_string {
 	my ($sum, $size, $file) = ($1, $2, $3);
 	if (exists($checksums->{$file}{$alg})
 	    and $checksums->{$file}{$alg} ne $sum) {
-	    error(_g("Conflicting checksums \`%s\' and \`%s' for file \`%s'"),
+	    error(_g("conflicting checksums '%s' and '%s' for file '%s'"),
 		  $checksums->{$file}{$alg}, $sum, $file);
 	}
 	if (exists $self->{size}{$file} and $self->{size}{$file} != $size) {
-	    error(_g("Conflicting file sizes \`%u\' and \`%u' for file \`%s'"),
+	    error(_g("conflicting file sizes '%u' and '%u' for file '%s'"),
 		  $self->{size}{$file}, $size, $file);
 	}
 	push @{$self->{files}}, $file unless exists $self->{size}{$file};

+ 2 - 2
scripts/Dpkg/Shlibs/Objdump.pm

@@ -220,7 +220,7 @@ sub parse_objdump_output {
 	    if (/^\S+\s+(\S+)\s+(\S+)\s*$/) {
 		$self->{dynrelocs}{$2} = $1;
 	    } else {
-		warning(_g("Couldn't parse dynamic relocation record: %s"), $_);
+		warning(_g("couldn't parse dynamic relocation record: %s"), $_);
 	    }
 	} elsif ($section eq 'dyninfo') {
 	    if (/^\s*NEEDED\s+(\S+)/) {
@@ -337,7 +337,7 @@ sub parse_dynamic_symbol {
 	# Ignore some s390-specific output like
 	# REG_G6           g     R *UND*      0000000000000000              #scratch
     } else {
-	warning(_g("Couldn't parse dynamic symbol definition: %s"), $line);
+	warning(_g("couldn't parse dynamic symbol definition: %s"), $line);
     }
 }
 

+ 2 - 2
scripts/Dpkg/Shlibs/SymbolFile.pm

@@ -223,7 +223,7 @@ sub parse {
 	    if ($self->create_symbol($2, base => $sym)) {
 		$self->add_symbol($sym, $$obj_ref);
 	    } else {
-		warning(_g('Failed to parse line in %s: %s'), $file, $_);
+		warning(_g('failed to parse line in %s: %s'), $file, $_);
 	    }
 	} elsif (/^(\(.*\))?#include\s+"([^"]+)"/) {
 	    my $tagspec = $1;
@@ -255,7 +255,7 @@ sub parse {
 		$self->create_object($$obj_ref, "$2");
 	    }
 	} else {
-	    warning(_g('Failed to parse a line in %s: %s'), $file, $_);
+	    warning(_g('failed to parse a line in %s: %s'), $file, $_);
 	}
     }
     delete $seen->{$file};

+ 2 - 2
scripts/Dpkg/Source/Archive.pm

@@ -149,11 +149,11 @@ sub extract {
     erasedir($dest);
     if (scalar(@entries) == 1 && ! -l "$tmp/$entries[0]" && -d _) {
 	rename("$tmp/$entries[0]", $dest) ||
-		syserr(_g('Unable to rename %s to %s'),
+		syserr(_g('unable to rename %s to %s'),
 		       "$tmp/$entries[0]", $dest);
     } else {
 	rename($tmp, $dest) ||
-		syserr(_g('Unable to rename %s to %s'), $tmp, $dest);
+		syserr(_g('unable to rename %s to %s'), $tmp, $dest);
     }
     erasedir($tmp);
 }

+ 2 - 2
scripts/dpkg-buildpackage.pl

@@ -430,7 +430,7 @@ if ($usepause &&
 my $signerrors;
 unless (build_binaryonly) {
     if ($signsource && signfile("$pv.dsc")) {
-	$signerrors = _g('Failed to sign .dsc and .changes file');
+	$signerrors = _g('failed to sign .dsc and .changes file');
 	$signchanges = 0;
     }
 }
@@ -490,7 +490,7 @@ if (fileomitted '\.deb') {
 }
 
 if ($signchanges && signfile("$pva.changes")) {
-    $signerrors = _g('Failed to sign .changes file');
+    $signerrors = _g('failed to sign .changes file');
 }
 
 if ($cleansource) {

+ 2 - 2
scripts/dpkg-gensymbols.pl

@@ -194,7 +194,7 @@ if (not scalar @files) {
             next PATH if -l $updir;
         }
 	opendir(my $libdir_dh, "$libdir") ||
-	    syserr(_g("Can't read directory %s: %s"), $libdir, $!);
+	    syserr(_g("can't read directory %s: %s"), $libdir, $!);
 	push @files, grep {
 	    /(\.so\.|\.so$)/ && -f $_ &&
 	    Dpkg::Shlibs::Objdump::is_elf($_);
@@ -209,7 +209,7 @@ foreach my $file (@files) {
     print "Scanning $file for symbol information\n" if $debug;
     my $objid = $od->analyze($file);
     unless (defined($objid) && $objid) {
-	warning(_g("Objdump couldn't parse %s\n"), $file);
+	warning(_g("Dpkg::Shlibs::Objdump couldn't parse %s\n"), $file);
 	next;
     }
     my $object = $od->get_object($objid);

+ 10 - 10
scripts/dpkg-scanpackages.pl

@@ -117,7 +117,7 @@ sub load_override
 		} elsif ($$package{Maintainer} eq $maintainer) {
 		    push(@samemaint, "  $p ($maintainer)");
 		} else {
-		    warning(_g('Unconditional maintainer override for %s'), $p);
+		    warning(_g('unconditional maintainer override for %s'), $p);
 		    $$package{Maintainer} = $maintainer;
 		}
 	    }
@@ -175,15 +175,15 @@ else {
 
 my ($binarydir, $override, $pathprefix) = @ARGV;
 
--d $binarydir or error(_g('Binary dir %s not found'), $binarydir);
+-d $binarydir or error(_g('binary dir %s not found'), $binarydir);
 defined($override) and (-e $override or
-    error(_g('Override file %s not found'), $override));
+    error(_g('override file %s not found'), $override));
 
 $pathprefix //= '';
 
 my $find_h = IO::Handle->new();
 open($find_h, '-|', 'find', '-L', "$binarydir/", @find_args, '-print')
-     or syserr(_g("Couldn't open %s for reading"), $binarydir);
+     or syserr(_g("couldn't open %s for reading"), $binarydir);
 FILE:
     while (<$find_h>) {
 	chomp;
@@ -202,7 +202,7 @@ FILE:
 	}
 
 	defined($fields->{'Package'})
-	    or error(_g('No Package field in control file of %s'), $fn);
+	    or error(_g('no Package field in control file of %s'), $fn);
 	my $p = $fields->{'Package'};
 
 	if (defined($packages{$p}) and not $options{multiversion}) {
@@ -210,20 +210,20 @@ FILE:
 		if (version_compare_relation($fields->{'Version'}, REL_GT,
 					     $_->{'Version'}))
                 {
-		    warning(_g('Package %s (filename %s) is repeat but newer version;'),
+		    warning(_g('package %s (filename %s) is repeat but newer version;'),
 		            $p, $fn);
 		    warning(_g('used that one and ignored data from %s!'),
 		            $_->{Filename});
 		    $packages{$p} = [];
 		} else {
-		    warning(_g('Package %s (filename %s) is repeat;'), $p, $fn);
+		    warning(_g('package %s (filename %s) is repeat;'), $p, $fn);
 		    warning(_g('ignored that one and using data from %s!'),
 		            $_->{Filename});
 		    next FILE;
 		}
 	    }
 	}
-	warning(_g('Package %s (filename %s) has Filename field!'), $p, $fn)
+	warning(_g('package %s (filename %s) has Filename field!'), $p, $fn)
 	    if defined($fields->{'Filename'});
 
 	$fields->{'Filename'} = "$pathprefix$fn";
@@ -255,11 +255,11 @@ for my $p (sort keys %packages) {
         push(@missingover,$p);
     }
     for my $package (@{$packages{$p}}) {
-	 print(STDOUT "$package\n") or syserr(_g('Failed when writing stdout'));
+	 print(STDOUT "$package\n") or syserr(_g('failed when writing stdout'));
          $records_written++;
     }
 }
-close(STDOUT) or syserr(_g("Couldn't close stdout"));
+close(STDOUT) or syserr(_g("couldn't close stdout"));
 
 if (@changedmaint) {
     warning(_g('Packages in override file with incorrect old maintainer value:'));

+ 1 - 1
scripts/dpkg-shlibdeps.pl

@@ -682,7 +682,7 @@ sub extract_from_shlibs {
     # Split soname in name/version
     my ($libname, $libversion) = split_soname($soname);
     unless (defined $libname) {
-	warning(_g("Can't extract name and version from library name \`%s'"),
+	warning(_g("can't extract name and version from library name '%s'"),
 	        $soname);
 	return;
     }

+ 1 - 1
scripts/t/600_Dpkg_Changelog.t

@@ -40,7 +40,7 @@ foreach my $file ("$datadir/countme", "$datadir/shadow", "$datadir/fields",
     my $changes = Dpkg::Changelog::Debian->new(verbose => 0);
     $changes->load($file);
 
-    open(my $clog_fh, '<', "$file") || die "Can't open $file\n";
+    open(my $clog_fh, '<', "$file") || die "can't open $file\n";
     my $content = file_slurp($clog_fh);
     close($clog_fh);
     cmp_ok($content, 'eq', "$changes", "string output of Dpkg::Changelog on $file");

+ 2 - 2
src/configure.c

@@ -405,8 +405,8 @@ deferred_configure(struct pkginfo *pkg)
 
 	if (pkg->eflag & eflag_reinstreq)
 		forcibleerr(fc_removereinstreq,
-		            _("Package is in a very bad inconsistent state - you should\n"
-		              " reinstall it before attempting configuration."));
+		            _("package is in a very bad inconsistent state; you should\n"
+		              " reinstall it before attempting configuration"));
 
 	printf(_("Setting up %s (%s) ...\n"), pkg_name(pkg, pnaw_nonambig),
 	       versiondescribe(&pkg->installed.version, vdew_nonambig));

+ 1 - 1
src/divertcmd.c

@@ -433,7 +433,7 @@ diversion_add(const char *const *argv)
 
 	if (file_from.stat_state == file_stat_valid &&
 	    S_ISDIR(file_from.stat.st_mode))
-		badusage(_("Cannot divert directories"));
+		badusage(_("cannot divert directories"));
 
 	fnn_from = findnamenode(filename, 0);
 

+ 1 - 1
src/infodb-upgrade.c

@@ -120,7 +120,7 @@ pkg_infodb_link_multiarch_files(void)
 			if (pkg->status != stat_notinstalled)
 				break;
 		if (!pkg) {
-			warning(_("Info file %s/%s not associated to any package"),
+			warning(_("info file %s/%s not associated to any package"),
 			        pkg_infodb_get_dir(), db_de->d_name);
 			continue;
 		}

+ 4 - 4
src/remove.c

@@ -116,8 +116,8 @@ void deferred_remove(struct pkginfo *pkg) {
   }
 
   if (pkg->installed.essential && pkg->status != stat_configfiles)
-    forcibleerr(fc_removeessential, _("This is an essential package -"
-                " it should not be removed."));
+    forcibleerr(fc_removeessential,
+                _("this is an essential package; it should not be removed"));
 
   debug(dbg_general, "checking dependencies for remove '%s'",
         pkg_name(pkg, pnaw_always));
@@ -150,8 +150,8 @@ void deferred_remove(struct pkginfo *pkg) {
 
   if (pkg->eflag & eflag_reinstreq)
     forcibleerr(fc_removereinstreq,
-                _("Package is in a very bad inconsistent state - you should\n"
-                " reinstall it before attempting a removal."));
+                _("package is in a very bad inconsistent state; you should\n"
+                  " reinstall it before attempting a removal"));
 
   ensure_allinstfiles_available();
   filesdbinit();