+2007-11-19 Raphael Hertzog <hertzog@debian.org>
+
+ * scripts/Dpkg/Path.pm: Fix behaviour of get_pkg_root_dir() when
+ there's no DEBIAN subdirectory in none of the parent directories.
+ * scripts/dpkg-shlibdeps.pl: Handle undef values returned by
+ get_pkg_root_dir() and complain when it's likely to create a
+ problem (when a RPATH contains $ORIGIN and when the value of
+ this variable can't be determined because we don't know what
+ is the root directory of the temporary tree).
+
2007-11-19 Guillem Jover <guillem@debian.org>
* configure.ac: Bump version to 1.14.9~.
dpkg (1.14.9) UNRELEASED; urgency=low
+ [ Raphael Hertzog ]
+ * Fix bad behaviour of Dpkg::Path::get_pkg_root_dir() and adjust
+ dpkg-shlibdeps accordingly.
+
[ Updated man pages translations ]
* German (Helge Kreutzmann).
the directory which contains the "DEBIAN" sub-directory and it will return
its path. This directory is the root directory of a package being built.
+If no DEBIAN subdirectory is found, it will return undef.
+
=cut
sub get_pkg_root_dir($) {
my $file = shift;
$file =~ s{/+$}{};
$file =~ s{/+[^/]+$}{} if not -d $file;
- do {
+ while ($file) {
return $file if -d "$file/DEBIAN";
last if $file !~ m{/};
$file =~ s{/+[^/]+$}{};
- } while ($file);
+ }
return undef;
}
# Create real RPATH in case $ORIGIN is used
# Note: ld.so also supports $PLATFORM and $LIB but they are
# used in real case (yet)
- my $origin = "/" . relative_to_pkg_root($execfile);
- $origin =~ s{/+[^/]*$}{};
+ my $libdir = relative_to_pkg_root($execfile);
+ my $origin;
+ if (defined $libdir) {
+ $origin = "/$libdir";
+ $origin =~ s{/+[^/]*$}{};
+ }
my @RPATH = ();
foreach my $path (@{$rpath}) {
- $path =~ s/\$ORIGIN/$origin/g;
- $path =~ s/\$\{ORIGIN\}/$origin/g;
+ if ($path =~ /\$ORIGIN|\$\{ORIGIN\}/) {
+ if (defined $origin) {
+ $path =~ s/\$ORIGIN/$origin/g;
+ $path =~ s/\$\{ORIGIN\}/$origin/g;
+ } else {
+ warning(_g("\$ORIGIN is used in RPATH of %s and the corresponding " .
+ "directory could not be identified due to lack of DEBIAN " .
+ "sub-directory in the root of package's build tree"), $execfile);
+ }
+ }
push @RPATH, $path;
}