Kaynağa Gözat

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.
Raphael Hertzog 18 yıl önce
ebeveyn
işleme
f52f2a333e
3 değiştirilmiş dosya ile 21 ekleme ve 2 silme
  1. 3 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 16 2
      scripts/dpkg-shlibdeps.pl

+ 3 - 0
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  <hertzog@debian.org>
 

+ 2 - 0
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

+ 16 - 2
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;
+	}
     }
 }