Kaynağa Gözat

dpkg-shlibdeps: Use dpkg-query instead of dpkg for --search

This has the effect of honoring the admindir passed as an environment
variable, as dpkg sets the variable unconditionally, but dpkg-query
does honor it.

Closes: #775258
Guillem Jover 11 yıl önce
ebeveyn
işleme
b815aaeb6f
2 değiştirilmiş dosya ile 5 ekleme ve 3 silme
  1. 2 0
      debian/changelog
  2. 3 3
      scripts/dpkg-shlibdeps.pl

+ 2 - 0
debian/changelog

@@ -39,6 +39,8 @@ dpkg (1.18.0) UNRELEASED; urgency=low
   * Document Dpkg::IPC function signatures.
   * Fix perl uninitialized value usage in dpkg-scansources when the Binary
     field is missing.
+  * Use dpkg-query instead of dpkg for --search in dpkg-shlibdeps so that
+    the subprocesses get the correct admindir. Closes: #775258
 
  -- Guillem Jover <guillem@debian.org>  Tue, 09 Dec 2014 23:53:18 +0100
 

+ 3 - 3
scripts/dpkg-shlibdeps.pl

@@ -5,7 +5,7 @@
 # Copyright © 1996 Ian Jackson
 # Copyright © 2000 Wichert Akkerman
 # Copyright © 2006 Frank Lichtenheld
-# Copyright © 2006-2010,2012-2013 Guillem Jover <guillem@debian.org>
+# Copyright © 2006-2010,2012-2015 Guillem Jover <guillem@debian.org>
 # Copyright © 2007 Raphaël Hertzog
 #
 # This program is free software; you can redistribute it and/or modify
@@ -838,14 +838,14 @@ sub find_packages {
     return $pkgmatch unless scalar(@files);
 
     my $pid = open(my $dpkg_fh, '-|');
-    syserr(g_('cannot fork for %s'), 'dpkg --search') unless defined($pid);
+    syserr(g_('cannot fork for %s'), 'dpkg-query --search') unless defined $pid;
     if (!$pid) {
 	# Child process running dpkg --search and discarding errors
 	close STDERR;
 	open STDERR, '>', '/dev/null'
 	    or syserr(g_('cannot open file %s'), '/dev/null');
 	$ENV{LC_ALL} = 'C';
-	exec('dpkg', '--search', '--', @files)
+	exec 'dpkg-query', '--search', '--', @files
 	    or syserr(g_('unable to execute %s'), 'dpkg');
     }
     while (<$dpkg_fh>) {