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

[lintian] 02/03: dplint: Separate restricted include dirs from regular ones



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

nthykier pushed a commit to branch master
in repository lintian.

commit 4a981a8af603bf85417e8870f55c53567780cf63
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Jul 16 08:45:08 2015 +0200

    dplint: Separate restricted include dirs from regular ones
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 commands/info.pm |  5 ++++-
 frontend/dplint  | 13 +++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)

diff --git a/commands/info.pm b/commands/info.pm
index 9046bfc..26845db 100644
--- a/commands/info.pm
+++ b/commands/info.pm
@@ -87,7 +87,10 @@ EOT
     $profile = Lintian::Profile->new(
         $prof,
         [dplint::include_dirs()],
-        { language => determine_locale() });
+        {
+            'language' => determine_locale(),
+            'restricted-search-dirs' => [dplint::restricted_include_dirs()],
+        });
 
     Lintian::Data->set_vendor($profile);
 
diff --git a/frontend/dplint b/frontend/dplint
index 3708a2e..6876422 100755
--- a/frontend/dplint
+++ b/frontend/dplint
@@ -64,8 +64,7 @@ use Getopt::Long();
 # is simply a placeholder to make the command work out of the box in
 # the source tree.
 my $INIT_ROOT = find_source_root();
-my $LINTIAN_VERSION;
-my @INCLUDE_DIRS;
+my ($LINTIAN_VERSION, @INCLUDE_DIRS, @RESTRICTED_INCLUDE_DIRS);
 
 my %BUILTINS = (
     'help' => \&builtin_help,
@@ -127,9 +126,9 @@ sub setup_env {
         if (exists($ENV{'HOME'}) or exists($ENV{'XDG_CONFIG_HOME'})) {
             $data_home = data_home('lintian');
         }
-        unshift(@INCLUDE_DIRS, $data_home)
+        unshift(@RESTRICTED_INCLUDE_DIRS, $data_home)
           if defined($data_home) && -d $data_home;
-        unshift(@INCLUDE_DIRS, '/etc/lintian')
+        unshift(@RESTRICTED_INCLUDE_DIRS, '/etc/lintian')
           if -d '/etc/lintian';
     }
 
@@ -137,6 +136,8 @@ sub setup_env {
 
     $ENV{'LINTIAN_ROOT'} = $INIT_ROOT;
     $ENV{'LINTIAN_INCLUDE_DIRS'} = join(':', grep { -d } @INCLUDE_DIRS);
+    $ENV{'LINTIAN_RESTRICTED_INCLUDE_DIRS'}
+      = join(':', grep { -d } @RESTRICTED_INCLUDE_DIRS);
     $ENV{'LINTIAN_HELPER_DIRS'} = join(
         ':',  grep { -d }
           map { "$_/helpers" } @INCLUDE_DIRS
@@ -178,6 +179,10 @@ sub include_dirs {
     return @INCLUDE_DIRS;
 }
 
+sub restricted_include_dirs {
+    return @RESTRICTED_INCLUDE_DIRS;
+}
+
 sub main {
     my $user_dirs = 1;
     my %opthash = (

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


Reply to: