The branch, master has been updated
       via  dbad623b0dbff674019e630286d46ed62c8ddb32 (commit)
       via  7e9e9a72c90b7bf159a217d2009889f7f3984f98 (commit)
      from  6bb4dcd9fbe0180709ed31ebb003ce7fce1aa07d (commit)


- Shortlog ------------------------------------------------------------
dbad623 dpkg-gencontrol.pl: Don't try to parse empty fields.
7e9e9a7 Bug fix in Dpkg::Path::get_pkg_root_dir() and related changes in 
dpkg-shlibdeps

Summary of changes:
 ChangeLog                  |   11 +++++++++++
 debian/changelog           |    5 +++++
 scripts/Dpkg/Path.pm       |    6 ++++--
 scripts/dpkg-gencontrol.pl |    2 +-
 scripts/dpkg-shlibdeps.pl  |   20 ++++++++++++++++----
 5 files changed, 37 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
Details of changes:

commit dbad623b0dbff674019e630286d46ed62c8ddb32
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Mon Nov 19 22:26:05 2007 +0100

    dpkg-gencontrol.pl: Don't try to parse empty fields.

diff --git a/ChangeLog b/ChangeLog
index 1acb091..3620978 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,7 @@
        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  <[EMAIL PROTECTED]>
 
diff --git a/debian/changelog b/debian/changelog
index c07bcd4..fd36dc4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -3,6 +3,7 @@ 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).
diff --git a/scripts/dpkg-gencontrol.pl b/scripts/dpkg-gencontrol.pl
index 7d80264..f34660b 100755
--- a/scripts/dpkg-gencontrol.pl
+++ b/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,

commit 7e9e9a72c90b7bf159a217d2009889f7f3984f98
Author: Raphael Hertzog <[EMAIL PROTECTED]>
Date:   Mon Nov 19 22:10:55 2007 +0100

    Bug fix in Dpkg::Path::get_pkg_root_dir() and related changes in 
dpkg-shlibdeps
    
    * 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).

diff --git a/ChangeLog b/ChangeLog
index a258fe8..1acb091 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2007-11-19  Raphael Hertzog  <[EMAIL PROTECTED]>
+
+       * 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  <[EMAIL PROTECTED]>
 
        * configure.ac: Bump version to 1.14.9~.
diff --git a/debian/changelog b/debian/changelog
index 1174a1d..c07bcd4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,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).
 
diff --git a/scripts/Dpkg/Path.pm b/scripts/Dpkg/Path.pm
index 5422e0f..32d57fc 100644
--- a/scripts/Dpkg/Path.pm
+++ b/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;
 }
 
diff --git a/scripts/dpkg-shlibdeps.pl b/scripts/dpkg-shlibdeps.pl
index e152e0f..1599aa6 100755
--- a/scripts/dpkg-shlibdeps.pl
+++ b/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;
     }
 

-- 
dpkg's main repository


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

Reply via email to