From: Raphael Hertzog Date: Tue, 25 Sep 2007 18:06:37 +0000 (+0200) Subject: Extend SymbolFile API to be able to dump it while leaving deprecated symbols out X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2c9ec8dcf5a6e58d92750a8ae19d202f86aa868d;p=dpkg Extend SymbolFile API to be able to dump it while leaving deprecated symbols out --- diff --git a/scripts/Dpkg/Shlibs/SymbolFile.pm b/scripts/Dpkg/Shlibs/SymbolFile.pm index 6489bd16..64448a1d 100644 --- a/scripts/Dpkg/Shlibs/SymbolFile.pm +++ b/scripts/Dpkg/Shlibs/SymbolFile.pm @@ -151,7 +151,7 @@ sub load { } sub save { - my ($self, $file) = @_; + my ($self, $file, $with_deprecated) = @_; $file = $self->{file} unless defined($file); my $fh; if ($file eq "-") { @@ -160,17 +160,19 @@ sub save { open($fh, ">", $file) || syserr(sprintf(_g("Can't open %s for writing: %s"), $file, $!)); } - $self->dump($fh); + $self->dump($fh, $with_deprecated); close($fh) if ($file ne "-"); } sub dump { - my ($self, $fh) = @_; + my ($self, $fh, $with_deprecated) = @_; + $with_deprecated = 1 unless defined($with_deprecated); foreach my $soname (sort keys %{$self->{objects}}) { print $fh "$soname $self->{objects}{$soname}{deps}[0]\n"; print $fh "| $_" foreach (@{$self->{objects}{$soname}{deps}}[ 1 .. -1 ]); foreach my $sym (sort keys %{$self->{objects}{$soname}{syms}}) { my $info = $self->{objects}{$soname}{syms}{$sym}; + next if $info->{deprecated} and not $with_deprecated; print $fh "#DEPRECATED: $info->{deprecated}#" if $info->{deprecated}; print $fh " $sym $info->{minver}"; print $fh " $info->{dep_id}" if $info->{dep_id};