The following commit has been merged in the master branch:
commit 305d8090caf90e16a963cfb962ea78fa185b5849
Author: Raphaël Hertzog <[email protected]>
Date:   Wed Mar 2 12:18:32 2011 +0100

    dpkg-shlibdeps: use get_control_path()
    
    Do not hardcode the location of shlibs/symbols files. They are under the
    control of dpkg. By using dpkg-query --control-path we ensure that we
    always use the correct location.
    
    Sponsored-by: Linaro Limited

diff --git a/debian/changelog b/debian/changelog
index 950eb17..c20d666 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -58,6 +58,8 @@ dpkg (1.16.0) UNRELEASED; urgency=low
     instead of -O2 when building ppc64 packages on Ubuntu. Closes: #612472
   * Add new function get_control_path() to Dpkg::Path, it wraps dpkg-query
     --control-path.
+  * Update dpkg-shlibdeps to be multiarch-ready:
+    - use get_control_path() to find symbols/shlibs files
 
   [ Jonathan Nieder ]
   * Remove support for use of synchronous sync(2), due to its pernicious
diff --git a/man/dpkg-shlibdeps.1 b/man/dpkg-shlibdeps.1
index 66f55df..bdbde1c 100644
--- a/man/dpkg-shlibdeps.1
+++ b/man/dpkg-shlibdeps.1
@@ -62,9 +62,9 @@ other binary packages.
 Per-system overriding shared library dependency information.
 \fIarch\fR is the architecture of the current system (obtained by
 .BR "dpkg-architecture -qDEB_HOST_ARCH" ).
-.IP \fIadmindir\fR/info/\fIpackage\fR.symbols
+.IP File returned by dpkg-query --control-path \fIpackage\fR symbols
 Package-provided shared library dependency information.
-Unless overridden, \fIadmindir\fR is /var/lib/dpkg.
+Unless overridden by --admindir, those files are located in /var/lib/dpkg.
 .P 
 While scanning the symbols used by all binaries,
 .B dpkg\-shlibdeps
@@ -96,9 +96,9 @@ Shared library information generated by the current build 
process that also invo
 They are only used if the library is found in a package's build tree. The
 shlibs file in that build tree takes precedence over shlibs files from
 other binary packages.
-.IP \fIadmindir\fR/info/\fIpackage\fR.shlibs
+.IP File returned by dpkg-query --control-path \fIpackage\fR shlibs
 Package-provided shared library dependency information.
-Unless overridden, \fIadmindir\fR is /var/lib/dpkg.
+Unless overridden by --admindir, those files are located in /var/lib/dpkg.
 .IP /etc/dpkg/shlibs.default
 Per-system default shared library dependency information.
 .P
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 506af64..3114937 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -26,7 +26,7 @@ use Dpkg;
 use Dpkg::Gettext;
 use Dpkg::ErrorHandling;
 use Dpkg::Path qw(relative_to_pkg_root guess_pkg_root_dir
-                 check_files_are_the_same);
+                 check_files_are_the_same get_control_path);
 use Dpkg::Version;
 use Dpkg::Shlibs qw(find_library @librarypaths);
 use Dpkg::Shlibs::Objdump;
@@ -91,6 +91,7 @@ foreach (@ARGV) {
        $admindir = $1;
        -d $admindir ||
            error(_g("administrative directory '%s' does not exist"), 
$admindir);
+       $ENV{'DPKG_ADMINDIR'} = $admindir;
     } elsif (m/^-d(.*)$/) {
        $dependencyfield = field_capitalize($1);
        defined($depstrength{$dependencyfield}) ||
@@ -635,7 +636,8 @@ sub add_shlibs_dep {
        # Fallback to other shlibs files but it shouldn't be necessary
        push @shlibs, @pkg_shlibs;
     } else {
-       push @shlibs, "$admindir/info/$pkg.shlibs";
+       my $control_file = get_control_path($pkg, "shlibs");
+       push @shlibs, $control_file if defined $control_file;
     }
     push @shlibs, $shlibsdefault;
     print " Looking up shlibs dependency of $soname provided by '$pkg'\n" if 
$debug;
@@ -723,8 +725,9 @@ sub find_symbols_file {
        push @files, @pkg_symbols;
     } else {
        push @files, "/etc/dpkg/symbols/$pkg.symbols.$host_arch",
-           "/etc/dpkg/symbols/$pkg.symbols",
-           "$admindir/info/$pkg.symbols";
+           "/etc/dpkg/symbols/$pkg.symbols";
+       my $control_file = get_control_path($pkg, "symbols");
+       push @files, $control_file if defined $control_file;
     }
 
     foreach my $file (@files) {

-- 
dpkg's main repository


-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to