Przeglądaj źródła

Merge branch 'master' of git://git.debian.org/git/dpkg/dpkg into sourcev3

Joey Hess 18 lat temu
rodzic
commit
73e6f9a488
5 zmienionych plików z 37 dodań i 7 usunięć
  1. 11 0
      ChangeLog
  2. 5 0
      debian/changelog
  3. 4 2
      scripts/Dpkg/Path.pm
  4. 1 1
      scripts/dpkg-gencontrol.pl
  5. 16 4
      scripts/dpkg-shlibdeps.pl

+ 11 - 0
ChangeLog

@@ -1,3 +1,14 @@
+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).
+	* scripts/dpkg-gencontrol.pl: Don't try to parse empty fields.
+
 2007-11-19  Guillem Jover  <guillem@debian.org>
 
 	* configure.ac: Bump version to 1.14.9~.

+ 5 - 0
debian/changelog

@@ -1,5 +1,10 @@
 dpkg (1.14.9) UNRELEASED; urgency=low
 
+  [ Raphael Hertzog ]
+  * Fix bad behaviour of Dpkg::Path::get_pkg_root_dir() and adjust
+    dpkg-shlibdeps accordingly.
+  * Fix dpkg-gencontrol to not try to parse and simplify empty fields.
+
   [ Updated man pages translations ]
     * German (Helge Kreutzmann).
 

+ 4 - 2
scripts/Dpkg/Path.pm

@@ -41,17 +41,19 @@ This function will scan upwards the hierarchy of directory to find out
 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;
 }
 

+ 1 - 1
scripts/dpkg-gencontrol.pl

@@ -249,7 +249,7 @@ if (exists $fi{"C$myindex Provides"}) {
 my (@seen_deps);
 foreach my $field (@pkg_dep_fields) {
     my $key = "C$myindex $field";
-    if (exists $fi{$key}) {
+    if (exists $fi{$key} and $fi{$key}) {
 	my $dep;
 	if ($dep_field_type{$field} eq 'normal') {
 	    $dep = Dpkg::Deps::parse(substvars($fi{$key}), use_arch => 1,

+ 16 - 4
scripts/dpkg-shlibdeps.pl

@@ -424,12 +424,24 @@ sub my_find_library {
     # 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;
     }