The branch, master has been updated
via 68a495083cd68a19af3eb17ae90a9dcfc81c0c4c (commit)
via fd4af2bc4801af30c4145dce30a3e2591ad223a6 (commit)
from 9278a6af560f99611270f479686d15cf5c4e1b86 (commit)
- Shortlog ------------------------------------------------------------
68a4950 dpkg-shlibdeps: adjust the search order of shlibs files
fd4af2b dpkg-shlibdeps: Add a new -S<pkgbuilddir> option
Summary of changes:
ChangeLog | 15 +++++++++++++
debian/changelog | 2 +
man/dpkg-shlibdeps.1 | 22 ++++++++++++++++---
scripts/dpkg-shlibdeps.pl | 49 +++++++++++++++++++++++++++++++-------------
4 files changed, 69 insertions(+), 19 deletions(-)
-----------------------------------------------------------------------
Details of changes:
commit 68a495083cd68a19af3eb17ae90a9dcfc81c0c4c
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date: Thu Jan 3 21:28:01 2008 +0100
dpkg-shlibdeps: adjust the search order of shlibs files
* scripts/dpkg-shlibdeps.pl (add_shlibs_dep): Use the same logic
as find_symbols_files to find shlibs files. Check
debian/*/DEBIAN/shlibs only when the library has not been found in
an installed package, and give precedence to the shlibs provided
by the binary package where the library has been found. Replaces
the previous work-around that gave precedence to the package
that contained the binary.
* man/dpkg-shlibdeps.1: Document the above change in the shlibs
search order.
diff --git a/ChangeLog b/ChangeLog
index 1d442cd..2d795fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,16 @@
trying to find a library.
* man/dpkg-shlibdeps.1: Document the new -S option.
+ * scripts/dpkg-shlibdeps.pl (add_shlibs_dep): Use the same logic
+ as find_symbols_files to find shlibs files. Check
+ debian/*/DEBIAN/shlibs only when the library has not been found in
+ an installed package, and give precedence to the shlibs provided
+ by the binary package where the library has been found. Replaces
+ the previous work-around that gave precedence to the package
+ that contained the binary.
+ * man/dpkg-shlibdeps.1: Document the above change in the shlibs
+ search order.
+
2008-01-03 Guillem Jover <[EMAIL PROTECTED]>
* scripts/dpkg-buildpackage.pl: Do not automatically enable '-j'
diff --git a/man/dpkg-shlibdeps.1 b/man/dpkg-shlibdeps.1
index 0039e10..f7cdf3b 100644
--- a/man/dpkg-shlibdeps.1
+++ b/man/dpkg-shlibdeps.1
@@ -53,6 +53,9 @@ Shared library information generated by the current build
process that also invo
.BR dpkg\-shlibdeps .
They are generated by
.BR dpkg\-gensymbols (1).
+They are only used if the library is found in a package's build tree. The
+symbols file in that build tree takes precedence over symbols files from
+other binary packages.
.IP /etc/dpkg/symbols/\fIpackage\fR.symbols.\fIarch\fR
.IP /etc/dpkg/symbols/\fIpackage\fR.symbols
Per-system overriding shared library dependency information.
@@ -89,6 +92,9 @@ Per-system overriding shared library dependency information.
.IP debian/*/DEBIAN/shlibs
Shared library information generated by the current build process that also
invoked
.BR dpkg\-shlibdeps .
+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
Package-provided shared library dependency information.
Unless overridden, \fIadmindir\fR is /var/lib/dpkg.
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index e62f515..4488def 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -103,7 +103,6 @@ my %shlibs;
my $cur_field;
foreach my $file (keys %exec) {
- my $pkg_root = guess_pkg_root_dir($file);
$cur_field = $exec{$file};
print "Scanning $file (for $cur_field field)\n" if $debug;
@@ -187,7 +186,7 @@ foreach my $file (keys %exec) {
my $libobj = $dumplibs_wo_symfile->get_object($id);
# Only try to generate a dependency for libraries with a SONAME
if ($libobj->is_public_library() and not
- add_shlibs_dep($soname, $pkg, $pkg_root)) {
+ add_shlibs_dep($soname, $pkg, $lib)) {
# This failure is fairly new, try to be kind by
# ignoring as many cases that can be safely ignored
my $ignore = 0;
@@ -451,12 +450,21 @@ sub update_dependency_version {
}
sub add_shlibs_dep {
- my ($soname, $pkg, $pkg_root) = @_;
+ my ($soname, $pkg, $libfile) = @_;
my @shlibs = ($shlibslocal, $shlibsoverride);
- # Make sure the shlibs of the current package is analyzed before the
- # shlibs of other binary package from the same source
- push @shlibs, "$pkg_root/DEBIAN/shlibs" if defined($pkg_root);
- push @shlibs, @pkg_shlibs, "$admindir/info/$pkg.shlibs", $shlibsdefault;
+ if ($pkg eq "") {
+ #Â If the file is not packaged, try to find out the shlibs file in
+ # the package being built where the lib has been found
+ my $pkg_root = guess_pkg_root_dir($libfile);
+ if (defined $pkg_root) {
+ push @shlibs, "$pkg_root/DEBIAN/shlibs";
+ }
+ # Fallback to other shlibs files but it shouldn't be necessary
+ push @shlibs, @pkg_shlibs;
+ } else {
+ push @shlibs, "$admindir/info/$pkg.shlibs";
+ }
+ push @shlibs, $shlibsdefault;
print "Looking up shlibs dependency of $soname provided by '$pkg'\n" if
$debug;
foreach my $file (@shlibs) {
next if not -e $file;
commit fd4af2bc4801af30c4145dce30a3e2591ad223a6
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date: Thu Jan 3 20:41:21 2008 +0100
dpkg-shlibdeps: Add a new -S<pkgbuilddir> option
* scripts/dpkg-shlibdeps.pl: Add a new -S<pkgbuilddir> option to
indicate a package build tree that should be scanned first when
trying to find a library.
* man/dpkg-shlibdeps.1: Document the new -S option.
diff --git a/ChangeLog b/ChangeLog
index e8670bf..1d442cd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,11 @@
a shlibs file).
* man/dpkg-shlibdeps.1: Document the change listed above.
+ * scripts/dpkg-shlibdeps.pl: Add a new -S<pkgbuilddir> option to
+ indicate a package build tree that should be scanned first when
+ trying to find a library.
+ * man/dpkg-shlibdeps.1: Document the new -S option.
+
2008-01-03 Guillem Jover <[EMAIL PROTECTED]>
* scripts/dpkg-buildpackage.pl: Do not automatically enable '-j'
diff --git a/debian/changelog b/debian/changelog
index 38afc06..9ace449 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -8,6 +8,8 @@ dpkg (1.14.15) UNRELEASED; urgency=low
* Fix typos in various manpages. Patch from A. Costa. Closes: #458276
* Make dpkg-shlibdeps choose the right symbols files when we have several
debian/*/DEBIAN/symbols for a given soname. Closes: #458860
+ * Add a -S<pkgbuilddir> option to dpkg-shlibdeps to indicate a package build
+ tree to scan first when trying to find a needed library.
[ Guillem Jover ]
* Move compression related variables to a new Dpkg::Compression module.
diff --git a/man/dpkg-shlibdeps.1 b/man/dpkg-shlibdeps.1
index 2190896..0039e10 100644
--- a/man/dpkg-shlibdeps.1
+++ b/man/dpkg-shlibdeps.1
@@ -180,6 +180,13 @@ avoid self-dependencies for packages which provide ELF
binaries
package. This option can be used multiple times to exclude several
packages.
.TP
+.BI \-S pkgbuilddir
+Look into \fIpkgbuilddir\fP first when trying to find a library. This is
+useful when the source package builds multiple flavors of the same library
+and you want to ensure that you get the dependency from a given binary
+package. You can use this option multiple times: directories will be
+tried in the same order before directories of other binary packages.
+.TP
.BI \-\-ignore\-missing\-info
Do not fail if dependency information can't be found for a shared library.
Usage of this option is discouraged, all libraries should provide
@@ -241,16 +248,17 @@ the RPATH of the binary, directories listed in
/etc/ld.so.conf,
directories listed in the LD_LIBRARY_PATH environment variable, and
standard public directories (/lib, /usr/lib, /lib32, /usr/lib32, /lib64,
/usr/lib64). Then it checks those directories in the package's build tree
-of the binary being analyzed, in other packages's build tree that contains
+of the binary being analyzed, in the packages's build trees indicated with
+the \-S command\-line option, in other packages's build trees that contains
a DEBIAN/shlibs or DEBIAN/symbols file and finally in the root directory.
If the library is not found in any of those directories, then you get this
error.
If the library not found is in a private directory of the same package,
then you want to add the directory to LD_LIBRARY_PATH. If it's in another
-binary package being built, you want to make sure that the shlibs file of
-this package is already created and that LD_LIBRARY_PATH contains the
-appropriate directory if it also is in a private directory.
+binary package being built, you want to make sure that the shlibs/symbols
+file of this package is already created and that LD_LIBRARY_PATH
+contains the appropriate directory if it also is in a private directory.
.TP
.BI "no dependency information found for " library\-file " (used by " binary
")."
The library needed by \fIbinary\fR has been found by
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index 4bf8948..e62f515 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/scripts/dpkg-shlibdeps.pl
@@ -38,6 +38,7 @@ my $varnameprefix = 'shlibs';
my $ignore_missing_info = 0;
my $debug = 0;
my @exclude = ();
+my @pkg_dir_to_search = ();
my $host_arch = get_host_arch();
my (@pkg_shlibs, @pkg_symbols, @pkg_root_dirs);
@@ -56,6 +57,8 @@ foreach (@ARGV) {
$varnameprefix = $1;
} elsif (m/^-L(.*)$/) {
$shlibslocal = $1;
+ } elsif (m/^-S(.*)$/) {
+ push @pkg_dir_to_search, $1;
} elsif (m/^-O$/) {
$stdout = 1;
} elsif (m/^-(h|-help)$/) {
@@ -389,6 +392,8 @@ Options:
-T<varlistfile> update variables here, not debian/substvars.
-t<type> set package type (default is deb).
-x<package> exclude package from the generated dependencies.
+ -S<pkgbuilddir> search needed libraries in the given
+ package build directory first.
--admindir=<directory> change the administrative directory.
-h, --help show this help message.
--version show the version.
@@ -591,17 +596,23 @@ sub my_find_library {
push @RPATH, $path;
}
- # Look into the packages we're currently building (but only those
- # that provides shlibs/symbols file and the one that contains the
- # binary being analyzed...)
- # TODO: we should probably replace that by a cleaner way to look into
- # the various temporary build directories...
- my @copy = (@pkg_root_dirs);
+ # Look into the packages we're currently building in the following
+ # order:
+ # - package build tree of the binary which is analyzed
+ # - package build tree given on the command line (option -S)
+ # - other package build trees that contain either a shlibs or a
+ # symbols file
+ my @builddirs;
my $pkg_root = guess_pkg_root_dir($execfile);
- unshift @copy, $pkg_root if defined $pkg_root;
- foreach my $builddir (@copy) {
+ push @builddirs, $pkg_root if defined $pkg_root;
+ push @builddirs, @pkg_dir_to_search;
+ push @builddirs, @pkg_root_dirs;
+ my %dir_checked;
+ foreach my $builddir (@builddirs) {
+ next if defined($dir_checked{$builddir});
$file = find_library($lib, [EMAIL PROTECTED], $format, $builddir);
return $file if defined($file);
+ $dir_checked{$builddir} = 1;
}
# Fallback in the root directory if we have not found what we were
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]