From 9f4c19234c7608b052e3d1dd5b0441b0727666b2 Mon Sep 17 00:00:00 2001 From: Raphael Hertzog Date: Mon, 24 Sep 2007 09:24:14 +0200 Subject: [PATCH] Fix parsing of shlibs files with respect to packagetype An shlibs line without packagetype should be used as fallback in case we don't find any dependency for that packagetype (udeb). So end the parsing in extract_shlibs only if the packagetype is given and if it matches with the current one. If the packagetype is not given, remember the dependency but continue parsing the file to check if we don't have a more specific dependency. --- scripts/dpkg-shlibdeps.pl | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl index fbb8b60d..c73d70af 100755 --- a/scripts/dpkg-shlibdeps.pl +++ b/scripts/dpkg-shlibdeps.pl @@ -336,10 +336,19 @@ sub extract_from_shlibs { warning(sprintf(_g("shared libs info file \`%s' line %d: bad line \`%s'"), $shlibfile, $., $_)); next; } - next if defined($1) and $1 ne $packagetype; if (($libname eq $2) && ($libversion eq $3)) { - $dep = $4; - last; + # Define dep and end here if the package type explicitely + # matches. Otherwise if the packagetype is not specified, use + # the dep only as a default that can be overriden by a later + # line + if (defined($1)) { + if ($1 eq $packagetype) { + $dep = $4; + last; + } + } else { + $dep = $4 unless defined $dep; + } } } close(SHLIBS); -- 2.39.5