Bug#521999: lintian: [checks/shared-libs] use pkgconfig files to check for missing -dev depends
On Tue, Mar 31, 2009 at 12:50:02AM -0300, Gustavo Noronha Silva wrote:
> I had a package rejected by ftpmaster because it was missing some
> dependencies on the new -dev package. Those dependencies are easily
> obtained from matching the pkgconfig Requires field to package names
> providing the pkgconfig package files.
>
> I wrote a patch to make lintian check for packages shipping .pc files
> and not declaring dependencies correctly, and am attaching.
[...]
> + open(PCFILE, "< unpacked/$file")
> + or fail("Could not open unpacked/$file for reading!");
> + while(<PCFILE>) {
> + next unless (m/^requires(\.private)?:(.+)$/i);
> + my @requirements = split(/ /, $2);
> + foreach my $requirement (@requirements) {
> + if ($PKGCONFIG_FILES->known($requirement)) {
> + my $required_package = $PKGCONFIG_FILES->value($requirement);
> + tag "pkgconfig-requirement-but-no-depends", "$requirement -> $required_package"
> + unless $info->relation('depends')->implies($required_package);
> + }
> + }
> + }
This will probably need to check whether the requirement is actually fulfilled
within the package we test. Take e.g. libcairo2-dev which provides several .pc
files which have requirements on each other.
Gruesse,
--
Frank Lichtenheld <djpig@debian.org>
www: http://www.djpig.de/
Reply to: