Przeglądaj źródła

dpkg-shlibdeps: improve parsing of output of dpkg --search

The returned package names can include ":" with foreign packages.
Modify the regex to allow this but also tighten it to match only
characters allowed in package names (plus ", " used as separator).

And anchor the match on the filename with the initial "/" as
a safety measure.

Sponsored-by: Linaro Limited
Raphaël Hertzog 15 lat temu
rodzic
commit
bd8ddb2fca
2 zmienionych plików z 2 dodań i 1 usunięć
  1. 1 0
      debian/changelog
  2. 1 1
      scripts/dpkg-shlibdeps.pl

+ 1 - 0
debian/changelog

@@ -60,6 +60,7 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     --control-path.
   * Update dpkg-shlibdeps to be multiarch-ready:
     - use get_control_path() to find symbols/shlibs files
+    - parse correctly the output of dpkg --search
 
   [ Jonathan Nieder ]
   * Remove support for use of synchronous sync(2), due to its pernicious

+ 1 - 1
scripts/dpkg-shlibdeps.pl

@@ -848,7 +848,7 @@ sub find_packages {
 	    warning(_g("diversions involved - output may be incorrect"));
 	    print(STDERR " $_\n")
 		|| syserr(_g("write diversion info to stderr"));
-	} elsif (m/^([^:]+): (\S+)$/) {
+	} elsif (m/^([-a-z0-9+.:, ]+): (\/.*)$/) {
 	    $cached_pkgmatch{$2} = $pkgmatch->{$2} = [ split(/, /, $1) ];
 	} else {
 	    warning(_g("unknown output from dpkg --search: '%s'"), $_);