[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.10-66-g1d6f672



The following commit has been merged in the master branch:
commit 1d6f672e65b1816c495c9c7a367fcc4c8c2dfb4d
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jul 22 12:43:27 2012 +0200

    L::Path: Resolve hardlinks relative to the package root
    
    The index information (i.e. tar vt) always lists the hardlink target
    relative to the package root.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index f3e9dfe..9a4c32f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -77,6 +77,9 @@ lintian (2.5.11) UNRELEASED; urgency=low
     + [NT] Always use Dpkg::Vendor to determine the default
       vendor.  Previously dpkg-vendor would be preferred if
       available.
+  * lib/Lintian/Path.pm:
+    + [NT] Always resolve hardlinks relative to the package
+      root.
   * lib/Lintian/Unpacker.pm:
     + [NT] New file.
 
diff --git a/lib/Lintian/Path.pm b/lib/Lintian/Path.pm
index a5895c2..88be416 100644
--- a/lib/Lintian/Path.pm
+++ b/lib/Lintian/Path.pm
@@ -118,8 +118,7 @@ If this is not a link, then this returns undef.
 
 If the path is a symlink this method can be used to determine if the
 symlink is relative or absolute.  This is I<not> true for hardlinks,
-as the hardlink normalization may change a relative link into an
-absolute link.
+where the link target is always relative to the root.
 
 NB: Even for symlinks, a leading "./" will be stripped.
 
@@ -244,7 +243,10 @@ sub link_resolved {
     my $name = $self->name;
     my $link = $self->link;
     croak "$name is not a link" unless defined $link;
-    my $target = resolve_pkg_path (dirname ($name), $link);
+    my $dir = $self->dirname;
+    # hardlinks are always relative to the package root
+    $dir = '/' if $self->is_hardlink;
+    my $target = resolve_pkg_path ($dir, $link);
     if ($target) {
         # map "." to ''.
         $target = '' if $target eq '.';

-- 
Debian package checker


Reply to: