The branch, master has been updated
       via  96ef60d7f55be3ed60d4ac43f346555aa228594f (commit)
      from  08499749543c2557649e8f558e138ea11986d1bb (commit)


- Shortlog ------------------------------------------------------------
96ef60d dpkg-shlibdeps: Fix filtering of duplicated deps in fields of lesser 
priority

Summary of changes:
 ChangeLog                 |    7 +++++++
 debian/changelog          |    2 ++
 scripts/dpkg-shlibdeps.pl |   24 ++++++++++++++++++------
 3 files changed, 27 insertions(+), 6 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit 96ef60d7f55be3ed60d4ac43f346555aa228594f
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Tue Jan 15 09:02:56 2008 +0100

    dpkg-shlibdeps: Fix filtering of duplicated deps in fields of lesser 
priority
    
    * scripts/dpkg-shlibdeps.pl (filter_deps): Fix filtering of
    duplicated dependencies in fields of lesser priority. Dependencies
    coming from shlibs files have no associated version and this case
    wasn't handled properly.

diff --git a/ChangeLog b/ChangeLog
index 013594a..78f6ec8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-01-15  Raphael Hertzog  <[EMAIL PROTECTED]>
+
+       * scripts/dpkg-shlibdeps.pl (filter_deps): Fix filtering of
+       duplicated dependencies in fields of lesser priority. Dependencies
+       coming from shlibs files have no associated version and this case
+       wasn't handled properly.
+
 2008-01-14  Raphael Hertzog  <[EMAIL PROTECTED]>
 
        * scripts/dpkg-genchanges.pl, scripts/dpkg-gencontrol.pl,
diff --git a/debian/changelog b/debian/changelog
index 3fb7c99..e8452bf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -31,6 +31,8 @@ dpkg (1.14.16) UNRELEASED; urgency=low
     is used. That way we're consistent with the definition of that variable
     in deb-substvars(5). Closes: #433477
   * Add support of Dm-Upload-Allowed field. Closes: #453400
+  * Fix dpkg-shlibdeps's filtering of duplicated dependencies in fields of
+    lesser priority (when -d is used).
 
   [ Updated manpages translations ]
   * Fix typo in French. Closes: #460021
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 8462d10..4b6a6e9 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -309,19 +309,29 @@ sub filter_deps {
     }
     # Don't include dependencies if they are already
     # mentionned in a higher priority field
-    if (not defined($depseen{$dep})) {
+    if (not exists($depseen{$dep})) {
        $depseen{$dep} = $dependencies{$field}{$dep};
        return 1;
     } else {
        # Since dependencies can be versionned, we have to
        # verify if the dependency is stronger than the
        # previously seen one
-       if (compare_versions($depseen{$dep}, '>>', 
$dependencies{$field}{$dep})) {
-           return 0;
+       my $stronger;
+       if ($depseen{$dep} eq $dependencies{$field}{$dep}) {
+           # If both versions are the same (possibly unversionned)
+           $stronger = 0;
+       } elsif ($dependencies{$field}{$dep} eq '') {
+           $stronger = 0; # If the dep is unversionned
+       } elsif ($depseen{$dep} eq '') {
+           $stronger = 1; # If the dep seen is unversionned
+       } elsif (compare_versions($depseen{$dep}, '>>', 
$dependencies{$field}{$dep})) {
+           # The version of the dep seen is stronger...
+           $stronger = 0;
        } else {
-           $depseen{$dep} = $dependencies{$field}{$dep};
-           return 1;
+           $stronger = 1;
        }
+       $depseen{$dep} = $dependencies{$field}{$dep} if $stronger;
+       return $stronger;
     }
 }
 
@@ -470,7 +480,9 @@ sub add_shlibs_dep {
        if (defined($dep)) {
            print "Found $dep in $file\n" if $debug;
            foreach (split(/,\s*/, $dep)) {
-               $dependencies{$cur_field}{$_} = 1;
+               # Note: the value is empty for shlibs based dependency
+               # symbol based dependency will put a version as value
+               $dependencies{$cur_field}{$_} = '';
            }
            return 1;
        }

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to