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

[lintian] 03/05: L::CScript: Avoid unnessary resolving of the same directory



This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository lintian.

commit 107819dcb9f7b777872652b7bd757f3f0cb03ff7
Author: Niels Thykier <niels@thykier.net>
Date:   Sun Jan 1 11:32:23 2017 +0000

    L::CScript: Avoid unnessary resolving of the same directory
    
    Every time, we created a Lintian::CheckScript object, it would resolve
    the directory containing the check.  However, dplint always resolves
    that path for us, so skip that resolution.
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 lib/Lintian/CheckScript.pm | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/lib/Lintian/CheckScript.pm b/lib/Lintian/CheckScript.pm
index 094e54a..90e2e5c 100644
--- a/lib/Lintian/CheckScript.pm
+++ b/lib/Lintian/CheckScript.pm
@@ -74,12 +74,10 @@ given, translations for the check will be loaded as well.
 sub new {
     my ($class, $basedir, $checkname, $profile, $lang) = @_;
     my ($header, @tags) = read_dpkg_control_utf8("$basedir/${checkname}.desc");
-    my ($self, $dir, $name);
+    my ($self, $name);
     unless ($name = $header->{'check-script'}) {
         croak "Missing Check-Script field in $basedir/${checkname}.desc";
     }
-    $dir = realpath($basedir)
-      or croak "Cannot resolve $basedir: $!";
 
     $self = {
         'name' => $header->{'check-script'},
@@ -92,7 +90,7 @@ sub new {
     $self->{'script_pkg'} =~ s,/,::,go;
     $self->{'script_pkg'} =~ s,[-.],_,go;
 
-    $self->{'script_path'} = $dir . '/' . $self->{'name'} . '.pm';
+    $self->{'script_path'} = $basedir . '/' . $self->{'name'} . '.pm';
 
     $self->{'script_run'} = undef; # init'ed with $self->load_check later
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git


Reply to: