+2008-01-18 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/Dpkg/Shlibs/SymbolFile.pm,
+ scripts/Dpkg/Shlibs/Objdump.pm, scripts/Dpkg/Shlibs.pm: Update and
+ fix many syserr(), error(), warning() and subprocerr() calls to
+ the new style where the sprintf call is integrated. Uniformize
+ some error messages at the same time.
+
2008-01-18 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Shlibs/SymbolFile.pm (load): Parse *@<version>
my %visited;
sub parse_ldso_conf {
my $file = shift;
- open my $fh, "<", $file
- or syserr(sprintf(_g("couldn't open %s"), $file));
+ open my $fh, "<", $file or syserr(_g("cannot open %s"), $file);
$visited{$file}++;
while (<$fh>) {
next if /^\s*$/;
}
}
}
- close $fh or syserr(sprintf(_g("couldn't close %s"), $file));;
+ close $fh;
}
# find_library ($soname, \@rpath, $format, $root)
return $format{$file};
}
}
- close(P) or subprocerr(sprintf(_g("objdump on \`%s'"), $file));
+ close(P) or subprocerr(_g("objdump on \`%s'"), $file);
}
}
}
sub is_elf {
my ($file) = @_;
- open(FILE, "<", $file) ||
- syserr(sprintf(_g("Can't open %s for test: %s"), $file, $!));
+ open(FILE, "<", $file) || syserr(_g("cannot read %s"), $file);
my ($header, $result) = ("", 0);
if (read(FILE, $header, 4) == 4) {
$result = 1 if ($header =~ /^\177ELF$/);
local $ENV{LC_ALL} = 'C';
open(my $objdump, "-|", "objdump", "-w", "-f", "-p", "-T", "-R", $file)
- || syserr(sprintf(_g("Can't execute objdump: %s"), $!));
+ || syserr(_g("cannot fork %s"), "objdump");
my $ret = $self->_parse($objdump);
close($objdump);
return $ret;
if (/^\S+\s+(\S+)\s+(\S+)\s*$/) {
$self->{dynrelocs}{$2} = $1;
} else {
- warning(sprintf(_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+)/) {
# Ignore some s390-specific output like
# REG_G6 g R *UND* 0000000000000000 #scratch
} else {
- warning(sprintf(_g("Couldn't parse dynamic symbol definition: %s"), $line));
+ warning(_g("Couldn't parse dynamic symbol definition: %s"), $line);
}
}
$seen->{$file} = 1;
open(my $sym_file, "<", $file)
- || syserr(sprintf(_g("Can't open %s: %s"), $file));
+ || syserr(_g("cannot open %s"), $file);
my $object = $current_object;
while (defined($_ = <$sym_file>)) {
chomp($_);
if (/^\s+(\S+)\s(\S+)(?:\s(\d+))?/) {
if (not defined ($object)) {
- error(sprintf(_g("Symbol information must be preceded by a header (file %s, line %s).", $file, $.)));
+ error(_g("Symbol information must be preceded by a header (file %s, line %s)."), $file, $.);
}
my $name = $1;
# New symbol
$self->create_object($object, "$2");
}
} else {
- warning(sprintf(_g("Failed to parse a line in %s: %s"), $file, $_));
+ warning(_g("Failed to parse a line in %s: %s"), $file, $_);
}
}
close($sym_file);
$fh = \*STDOUT;
} else {
open($fh, ">", $file)
- || syserr(sprintf(_g("Can't open %s for writing: %s"), $file, $!));
+ || syserr(_g("cannot write %s"), $file);
}
$self->dump($fh, $with_deprecated);
close($fh) if ($file ne "-");