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 <guillem@debian.org>
* scripts/dpkg-buildpackage.pl: Do not automatically enable '-j'
* 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.
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
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
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);
$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)$/) {
-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.
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, \@RPATH, $format, $builddir);
return $file if defined($file);
+ $dir_checked{$builddir} = 1;
}
# Fallback in the root directory if we have not found what we were