the deprecated version of a symbol if it is already marked
deprecated.
+2007-12-09 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/Dpkg/Shlibs/SymbolFile.pm: Parse and dump properly
+ new meta-information fields (on lines starting with an asterisk).
+ Bugfix with alternate dependency handling that were not properly
+ dumped.
+ * scripts/t/200_Dpkg_Shlibs.t,
+ scripts/t/200_Dpkg_Shlibs/symbols.fake-2: Add a test case to
+ verify that meta-information fields and alternate dependencies are
+ properly parsed and dumped.
+
2007-12-09 Raphael Hertzog <hertzog@debian.org>
* scripts/Dpkg/Shlibs/SymbolFile.pm (load): Pass the current
* po/de.po: Updated to 1335t0f48u.
+2007-12-09 Raphael Hertzog <hertzog@debian.org>
+
+ * deb-symbols.5: Describe syntax of meta-information
+ fields and document the Build-Depends-Package field.
+
2007-12-09 Raphael Hertzog <hertzog@debian.org>
* dpkg-gensymbols.1: Remove the restriction that included files
.br
[ | <alternative dependency template> ]
.br
+[ ... ]
+.br
+[ * <field-name>: <field value> ]
+.br
[ ... ]
<symbol> <mininal version>[ <id of dependency template> ]
.P
template is used if \fIid of dependency template\fR is not present). The
first alternative dependency template is numbered 1, the second one 2,
etc.
+.P
+Each entry for a library can also have some fields of meta-information.
+Those fields are stored on lines starting with an asterisk. Currently,
+the only valid field is \fIBuild-Depends-Package\fR, it indicates the name
+of the "-dev" package associated to the library and is used by
+dpkg-shlibdeps to make sure that the dependency generated is at least as
+strict as the corresponding build dependency.
.SH EXAMPLES
.SS Simple symbols file
.PP
libGL.so.1 libgl1
.br
| libgl1-mesa-glx #MINVER#
+.br
+* Build-Depends-Package: libgl1-mesa-dev
publicGlSymbol@Base 6.3-1
[...]
implementationSpecificSymbol@Base 6.5.2-7 1
use Dpkg::Gettext;
use Dpkg::ErrorHandling qw(syserr warning error);
use Dpkg::Version qw(vercmp);
+use Dpkg::Fields qw(capit);
my %blacklist = (
'__bss_end__' => 1, # arm
} elsif (/^\|\s*(.*)$/) {
# Alternative dependency template
push @{$self->{objects}{$object}{deps}}, "$1";
+ } elsif (/^\*\s*([^:]+):\s*(.*\S)\s*$/) {
+ # Add meta-fields
+ $self->{objects}{$object}{fields}{capit($1)} = $2;
} elsif (/^(\S+)\s+(.*)$/) {
# New object and dependency template
$object = $1;
$self->{objects}{$object}{deps} = [ "$2" ];
} else {
# Create a new object
- $self->{objects}{$object} = {
- syms => {},
- deps => [ "$2" ]
- };
+ $self->create_object($object, "$2");
}
} else {
warning(sprintf(_g("Failed to parse a line in %s: %s"), $file, $_));
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 ]);
+ my @deps = @{$self->{objects}{$soname}{deps}};
+ print $fh "$soname $deps[0]\n";
+ shift @deps;
+ print $fh "| $_\n" foreach (@deps);
+ my $f = $self->{objects}{$soname}{fields};
+ print $fh "* $_: $f->{$_}\n" foreach (sort keys %{$f});
foreach my $sym (sort keys %{$self->{objects}{$soname}{syms}}) {
my $info = $self->{objects}{$soname}{syms}{$sym};
next if $info->{deprecated} and not $with_deprecated;
my ($self, $soname, @deps) = @_;
$self->{objects}{$soname} = {
syms => {},
+ fields => {},
deps => [ @deps ]
};
}
# -*- mode: cperl;-*-
-use Test::More tests => 33;
+use Test::More tests => 34;
+use IO::String;
use strict;
use warnings;
'depends' => 'libvirtualfake', 'soname' => 'libfake.so.1' },
'overrides order with circular #include');
+# Check dump output
+my $io = IO::String->new();
+$sym_file->dump($io);
+is(${$io->string_ref()},
+'libfake.so.1 libfake1 #MINVER#
+| libvirtualfake
+* Build-Depends-Package: libfake-dev
+ symbol1_fake2@Base 1.0 1
+ symbol2_fake2@Base 1.0
+ symbol3_fake2@Base 1.0
+', "Dump of $srcdir/symbols.include-2");
+
+
# Check parsing of objdump output on ia64 (local symbols
# without versions and with visibility attribute)
$obj = Dpkg::Shlibs::Objdump::Object->new;
#include "symbols.include-2"
# This is just a comment
libfake.so.1 libfake1 #MINVER#
+* Build-Depends-Package: libfake-dev
# The alternate dependency is below
| libvirtualfake
symbol1_fake2@Base 1.0 1