Author: djpig
Date: 2007-07-09 21:35:22 +0000 (Mon, 09 Jul 2007)
New Revision: 862
Modified:
branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/Objdump.pm
Log:
Dpkg::Shlibs::Objdump: More code cleanup
Remove unnessesary quotes
If you use $_ as a loop variable, actually use the
advantages it gives
Modified: branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/Objdump.pm
===================================================================
--- branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/Objdump.pm 2007-07-09
20:41:20 UTC (rev 861)
+++ branches/dpkg-shlibdeps-buxy/scripts/Dpkg/Shlibs/Objdump.pm 2007-07-09
21:35:22 UTC (rev 862)
@@ -36,22 +36,22 @@
my $obj = Dpkg::Shlibs::Objdump::Object->new($file);
my $section = "none";
while (defined($_ = <OBJDUMP>)) {
- chomp($_);
+ chomp;
next if (/^\s*$/);
- if ($_ =~ /^DYNAMIC SYMBOL TABLE:/) {
+ if (/^DYNAMIC SYMBOL TABLE:/) {
$section = "dynsym";
next;
- } elsif ($_ =~ /^Dynamic Section:/) {
+ } elsif (/^Dynamic Section:/) {
$section = "dyninfo";
next;
- } elsif ($_ =~ /^Program Header:/) {
+ } elsif (/^Program Header:/) {
$section = "header";
next;
- } elsif ($_ =~ /^Version definitions:/) {
+ } elsif (/^Version definitions:/) {
$section = "verdef";
next;
- } elsif ($_ =~ /^Version References:/) {
+ } elsif (/^Version References:/) {
$section = "verref";
next;
}
@@ -59,19 +59,19 @@
if ($section eq "dynsym") {
$self->parse_dynamic_symbol($_, $obj);
} elsif ($section eq "dyninfo") {
- if ($_ =~ /^\s*NEEDED\s+(\S+)/) {
+ if (/^\s*NEEDED\s+(\S+)/) {
push @{$obj->{NEEDED}}, $1;
- } elsif ($_ =~ /^\s*SONAME\s+(\S+)/) {
+ } elsif (/^\s*SONAME\s+(\S+)/) {
$obj->{SONAME} = $1;
- } elsif ($_ =~ /^\s*HASH\s+(\S+)/) {
+ } elsif (/^\s*HASH\s+(\S+)/) {
$obj->{HASH} = $1;
- } elsif ($_ =~ /^\s*GNU_HASH\s+(\S+)/) {
+ } elsif (/^\s*GNU_HASH\s+(\S+)/) {
$obj->{GNU_HASH} = $1;
- } elsif ($_ =~ /^\s*RPATH\s+(\S+)/) {
+ } elsif (/^\s*RPATH\s+(\S+)/) {
push @{$obj->{RPATH}}, split (/:/, $1);
}
} elsif ($section eq "none") {
- if ($_ =~ /^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
+ if (/^\s*\S+:\s*file\s+format\s+(\S+)\s*$/) {
$obj->{format} = $1;
}
}
@@ -120,22 +120,22 @@
my ($flags, $sect, $ver, $name) = ($1, $2, $3, $4);
my $symbol = {
- 'name' => $name,
- 'version' => defined($ver) ? $ver : '',
- 'section' => $sect,
- 'dynamic' => substr($flags, 5, 1) eq "D",
- 'debug' => substr($flags, 5, 1) eq "d",
- 'type' => substr($flags, 6, 1),
- 'weak' => substr($flags, 1, 1) eq "w",
- 'hidden' => 0,
- 'defined' => $sect ne '*UND*'
+ name => $name,
+ version => defined($ver) ? $ver : '',
+ section => $sect,
+ dynamic => substr($flags, 5, 1) eq "D",
+ debug => substr($flags, 5, 1) eq "d",
+ type => substr($flags, 6, 1),
+ weak => substr($flags, 1, 1) eq "w",
+ hidden => 0,
+ defined => $sect ne '*UND*'
};
- # Handle hidden symbols
+ # Handle hidden symbols
if (defined($ver) and $ver =~ /^\((.*)\)$/) {
$ver = $1;
- $symbol->{'version'} = $1;
- $symbol->{'hidden'} = 1;
+ $symbol->{version} = $1;
+ $symbol->{hidden} = 1;
}
# Register symbol
@@ -208,11 +208,11 @@
my $file = shift || '';
my $class = ref($this) || $this;
my $self = {
- 'file' => $file,
- 'SONAME' => '',
- 'NEEDED' => [],
- 'RPATH' => [],
- 'dynsyms' => {}
+ file => $file,
+ SONAME => '',
+ NEEDED => [],
+ RPATH => [],
+ dynsyms => {}
};
bless $self, $class;
return $self;
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]