summaryrefslogtreecommitdiff
path: root/scripts/Dpkg/Shlibs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dpkg/Shlibs')
-rw-r--r--scripts/Dpkg/Shlibs/Symbol.pm9
-rw-r--r--scripts/Dpkg/Shlibs/SymbolFile.pm15
2 files changed, 16 insertions, 8 deletions
diff --git a/scripts/Dpkg/Shlibs/Symbol.pm b/scripts/Dpkg/Shlibs/Symbol.pm
index d1920e14f..88650b351 100644
--- a/scripts/Dpkg/Shlibs/Symbol.pm
+++ b/scripts/Dpkg/Shlibs/Symbol.pm
@@ -436,4 +436,13 @@ sub mark_not_found_in_library {
}
}
+# Quickly checks if the symbol (or pattern) can be considered as new due to its
+# status or current environment settings.
+sub is_eligible_as_new {
+ my ($self, $arch) = @_;
+ return ! $self->{deprecated} &&
+ ! $self->is_optional() &&
+ $self->arch_is_concerned($arch);
+}
+
1;
diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm
index 433e5d127..65f85a32e 100644
--- a/scripts/Dpkg/Shlibs/SymbolFile.pm
+++ b/scripts/Dpkg/Shlibs/SymbolFile.pm
@@ -439,16 +439,15 @@ sub get_new_symbols {
my $mysyms = $self->{objects}{$soname}{syms};
next if not exists $ref->{objects}{$soname};
my $refsyms = $ref->{objects}{$soname}{syms};
- foreach my $sym (grep { not $mysyms->{$_}{deprecated} and
- not $mysyms->{$_}->is_optional() and
- $mysyms->{$_}->arch_is_concerned($self->{arch})
- } keys %{$mysyms})
+ foreach my $sym (grep { $_->is_eligible_as_new($self->{arch}) }
+ values %$mysyms)
{
- if ((not exists $refsyms->{$sym}) or
- $refsyms->{$sym}{deprecated} or
- not $refsyms->{$sym}->arch_is_concerned($self->{arch}) )
+ my $refsym = $refsyms->{$sym->get_symbolname()};
+ if ((not defined $refsym) or
+ $refsym->{deprecated} or
+ not $refsym->arch_is_concerned($self->{arch}) )
{
- push @res, $mysyms->{$sym}->sclone(soname => $soname);
+ push @res, $sym->sclone(soname => $soname);
}
}
}