From f52f2a333ef7609ddd7e9cab832f49295ff21dd9 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Tue, 15 Jan 2008 10:43:28 +0100 Subject: [PATCH] dpkg-shlibdeps: handle the case where the same binary is listed multiple times * scripts/dpkg-shlibdeps.pl: When the same binary is passed several times as parameters (associated to different fields), associate it to the most important field. --- ChangeLog | 3 +++ debian/changelog | 2 ++ scripts/dpkg-shlibdeps.pl | 18 ++++++++++++++++-- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78f6ec8f..6ae22557 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,9 @@ duplicated dependencies in fields of lesser priority. Dependencies coming from shlibs files have no associated version and this case wasn't handled properly. + * scripts/dpkg-shlibdeps.pl: When the same binary is passed + several times as parameters (associated to different fields), + associate it to the most important field. 2008-01-14 Raphael Hertzog diff --git a/debian/changelog b/debian/changelog index e8452bfa..5778f49f 100644 --- a/debian/changelog +++ b/debian/changelog @@ -33,6 +33,8 @@ dpkg (1.14.16) UNRELEASED; urgency=low * 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). + * Fix behaviour of dpkg-shlibdeps when the same binary was passed multiple + times for use in different dependency fields (-d option). [ Updated manpages translations ] * Fix typo in French. Closes: #460021 diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index 4b6a6e9d..3d68585c 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -72,7 +72,14 @@ foreach (@ARGV) { defined($depstrength{$dependencyfield}) || warning(_g("unrecognised dependency field \`%s'"), $dependencyfield); } elsif (m/^-e(.*)$/) { - $exec{$1} = $dependencyfield; + if (exists $exec{$1}) { + # Affect the binary to the most important field + if ($depstrength{$dependencyfield} > $depstrength{$exec{$1}}) { + $exec{$1} = $dependencyfield; + } + } else { + $exec{$1} = $dependencyfield; + } } elsif (m/^--ignore-missing-info$/) { $ignore_missing_info = 1; } elsif (m/^-t(.*)$/) { @@ -84,7 +91,14 @@ foreach (@ARGV) { } elsif (m/^-/) { usageerr(_g("unknown option \`%s'"), $_); } else { - $exec{$_} = $dependencyfield; + if (exists $exec{$_}) { + # Affect the binary to the most important field + if ($depstrength{$dependencyfield} > $depstrength{$exec{$_}}) { + $exec{$_} = $dependencyfield; + } + } else { + $exec{$_} = $dependencyfield; + } } } -- 2.39.5