Package: dpkg-dev
Severity: wishlist
Tags: d-i

This BR is the formal request to implement the support for parsing an 
extra line in shlibs files when determining dependencies for udebs.
This subject has been discussed before on the d-dpkg list [1]. The patch 
then proposed still applies cleanly and is attached here.

We (the D-I team) have now tested the implementation and also created the 
patches needed in debhelper (see #345471 and #345472) to correctly 
generate the udeb: lines in the shlibs files and to use the new -t option 
in dpkg-shlibdeps. The changes in dpkg-dev and debhelper together have 
been tested and resulted in correct dependencies being generated.

We would appreciate it if a new version of dpkg-dev including this patch 
could be uploaded ASAP, as the problems with creating correct 
dependencies for udebs currently block us from integrating the building 
of the new graphical version of d-i into the official build system.

TIA,
Frans Pop
(D-I release manager)

[1] http://lists.debian.org/debian-dpkg/2005/06/msg00198.html

diff -ur old/dpkg-1.13.9/man/C/dpkg-source.1 dpkg-1.13.9/man/C/dpkg-source.1
--- old/dpkg-1.13.9/man/C/dpkg-source.1 2005-06-11 14:30:46.000000000 -0400
+++ dpkg-1.13.9/man/C/dpkg-source.1     2005-06-25 10:54:42.000000000 -0400
@@ -516,7 +516,7 @@
 .TP
 .BI \-L localshlibsfile
 Causes
-.B dpkg\-shlibs
+.B dpkg\-shlibdeps
 to read overriding shared library dependency information from
 .I localshlibsfile
 instead of
@@ -527,6 +527,15 @@
 output, rather than being added to the substitution variables file
 .RB ( debian/substvars
 by default).
+.TP
+.BI \-t type
+Causes
+.B dpkg\-shlibdeps
+to prefer shared library dependency information tagged for the given
+package type. If no tagged information is available, falls back to untagged
+information. The default package type is "deb". Shared library dependency
+information is tagged for a given type by prefixing it with the name of the
+type, a colon, and whitespace.
 .SH dpkg\-GENCHANGES OPTIONS
 .B dpkg\-genchanges
 does not take any non-option arguments.
Only in dpkg-1.13.9/scripts: debian
diff -ur old/dpkg-1.13.9/scripts/dpkg-shlibdeps.pl 
dpkg-1.13.9/scripts/dpkg-shlibdeps.pl
--- old/dpkg-1.13.9/scripts/dpkg-shlibdeps.pl   2005-06-06 00:07:12.000000000 -0400
+++ dpkg-1.13.9/scripts/dpkg-shlibdeps.pl       2005-06-25 11:36:45.000000000 -0400
@@ -17,6 +17,7 @@
 $varnameprefix= 'shlibs';
 $dependencyfield= 'Depends';
 $varlistfile= 'debian/substvars';
+$packagetype= 'deb';
 
 @depfields= qw(Suggests Recommends Depends Pre-Depends);
 
@@ -42,6 +43,7 @@
        -O                     print variable settings to stdout
        -L<localshlibsfile>    shlibs override file, not debian/shlibs.local
        -T<varlistfile>        update variables here, not debian/substvars
+       -t<type>               set package type (default is deb)
 Dependency fields recognised are ".join("/",@depfields)."
 ";
 }
@@ -66,6 +68,8 @@
             &warn("unrecognised dependency field \`$dependencyfield'");
     } elsif (m/^-e/) {
         push(@exec,$'); push(@execf,$dependencyfield);
+    } elsif (m/^-t/) {
+        $packagetype= $';
     } elsif (m/^-/) {
         usageerr("unknown option \`$_'");
     } else {
@@ -237,33 +241,37 @@
 
     while (<SLF>) {
         s/\s*\n$//; next if m/^\#/;
-        if (!m/^\s*(\S+)\s+(\S+)/) {
+        if (!m/^\s*(?:(\S+):\s+)?(\S+)\s+(\S+)/) {
             &warn("shared libs info file \`$fn' line $.: bad line \`$_'");
             next;
         }
-        next if $1 ne $ln || $2 ne $lsn;
+        next if defined $1 && $1 ne $packagetype;
+        next if $2 ne $ln || $3 ne $lsn;
         return 1 if $fn eq "$curpackdir/DEBIAN/shlibs";
         $da= $';
-        for $dv (split(/,/,$da)) {
-            $dv =~ s/^\s+//; $dv =~ s/\s+$//;
-            if (defined($depstrength{$lf})) {
-                if (!defined($predefdepfdep{$dv}) ||
-                    $depstrength{$predefdepfdep{$dv}} < $depstrength{$lf}) {
-                    $predefdepfdep{$dv}= $lf;
-                }
-            } else {
-                $dk= "$lf: $dv";
-                if (!defined($unkdepfdone{$dk})) {
-                    $unkdepfdone{$dk}= 1;
-                    $unkdepf{$lf}.= ', ' if length($unkdepf{$lf});
-                    $unkdepf{$lf}.= $dv;
-                }
+        last if defined $1; # exact match, otherwise keep looking
+    }
+    close(SLF);
+        
+    return 0 unless defined $da;
+
+    for $dv (split(/,/,$da)) {
+        $dv =~ s/^\s+//; $dv =~ s/\s+$//;
+        if (defined($depstrength{$lf})) {
+            if (!defined($predefdepfdep{$dv}) ||
+                $depstrength{$predefdepfdep{$dv}} < $depstrength{$lf}) {
+                $predefdepfdep{$dv}= $lf;
+            }
+        } else {
+            $dk= "$lf: $dv";
+            if (!defined($unkdepfdone{$dk})) {
+                $unkdepfdone{$dk}= 1;
+                $unkdepf{$lf}.= ', ' if length($unkdepf{$lf});
+                $unkdepf{$lf}.= $dv;
             }
         }
-        return 1;
     }
-    close(SLF);
-    return 0;
+    return 1;
 }
 
 if (!$stdout) {

Attachment: pgpDY5E7MgMei.pgp
Description: PGP signature

Reply via email to