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

[SCM] Debian package checker branch, master, updated. 2.5.11-225-g830d409



The following commit has been merged in the master branch:
commit 830d409e0ab395cd8708856584d0786e8d64a7e0
Author: Niels Thykier <niels@thykier.net>
Date:   Thu Apr 4 15:47:08 2013 +0200

    lintian: Stop exporting LINTIAN_LAB and remove @MUST_EXPORT
    
    Stop exporting LINTIAN_LAB as nothing relies on it anymore.  Since
    that leaves only LINTIAN_ROOT in @MUST_EXPORT, remove that as well
    (and export LINTIAN_ROOT manually).
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/debian/changelog b/debian/changelog
index e91684a..2567891 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -203,6 +203,7 @@ lintian (2.5.12) UNRELEASED; urgency=low
       /etc/xdg/lintian/lintianrc.  The previous lintianrc paths are
       still accepted.
     + [NT] Stop looking for lintianrc files in the LINTIAN_ROOT.
+    + [NT] Stop exporting LINTIAN_LAB to processes run by lintian.
 
   * lib/*:
     + [NT] Use "parent" instead of the "base" pragma.
diff --git a/frontend/lintian b/frontend/lintian
index a146367..974f7ab 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -34,14 +34,6 @@ use POSIX qw(:sys_wait_h);
 
 # {{{ Application Variables
 
-# Variables from %opt (defined below) we must export to %ENV
-my @MUST_EXPORT = (qw(
-    LINTIAN_LAB
-    LINTIAN_ROOT
-));
-# LINTIAN_DEBUG, but that is handled separately
-# TMPDIR, handled separatedly
-
 # Environment variables Lintian cares about - the list contains
 # the ones that can also be set via the config file
 #
@@ -50,8 +42,7 @@ my @MUST_EXPORT = (qw(
 # updated to use the ENV variable if the one in %opt is undef
 # and ENV has a value.
 #
-# NB: Variables listed here are not always exported - use @MUST_EXPORT
-# for that.
+# NB: Variables listed here are not always exported.
 my @ENV_VARS = (
 # LINTIAN_CFG  - handled manually
 # LINTIAN_ROOT - handled manually
@@ -570,6 +561,8 @@ if (defined $opt{'LINTIAN_ROOT'}) {
 } else {
     $opt{'LINTIAN_ROOT'} = '/usr/share/lintian';
 }
+# exported for collections, which are run as an external process.
+$ENV{'LINTIAN_ROOT'} = $opt{'LINTIAN_ROOT'};
 
 # Filter out non-existent paths and resolve the rest.
 # - as we will add them to @INC, make sure they are resolved
@@ -769,16 +762,6 @@ if ($opt{'color'} and $opt{'color'} !~ /^(?:never|always|auto|html)$/) {
     die "The color value must be one of \"never\", \"always\", \"auto\" or \"html\"\n";
 }
 
-# export current settings for our helper scripts
-foreach my $var (@MUST_EXPORT) {
-    if ($opt{$var}) {
-        $ENV{$var} = $opt{$var};
-    } else {
-        $ENV{$var} ='';
-        $opt{$var} = ''; # Avoids some undef warnings later
-    }
-}
-
 # We do this manually since the above would set $ENV{TMPDIR} to ''
 # if it was undef and that causes tempdir to give us some "funny"
 # (read: broken) paths.
@@ -838,7 +821,7 @@ debug_msg(1,
           $BANNER,
           "Lintian root directory: $opt{'LINTIAN_ROOT'}",
           "Configuration file: $opt{'LINTIAN_CFG'}",
-          "Laboratory: $opt{'LINTIAN_LAB'}",
+          'Laboratory: ' . ($opt{'LINTIAN_LAB'} // '<N/A>'),
           delimiter(),
     );
 
diff --git a/lib/Lintian/Lab.pm b/lib/Lintian/Lab.pm
index 7106f4b..18a66ff 100644
--- a/lib/Lintian/Lab.pm
+++ b/lib/Lintian/Lab.pm
@@ -101,7 +101,7 @@ well as providing access to the entries.
 
 =item new ([DIR])
 
-Creates a new Lab instance.  If DIR is passed it will be used as
+Creates a new Lab instance.  If DIR is defined it will be used as
 the path to the lab and the lab will be in static mode.  Otherwise the
 lab will be in temporary mode and will point to a temporary directory.
 
@@ -112,7 +112,7 @@ sub new {
     my $absdir;
     my $mode = LAB_MODE_TEMP;
     my $dok = 1;
-    if ($dir) {
+    if (defined $dir) {
         $mode = LAB_MODE_STATIC;
         $absdir = Cwd::abs_path ($dir);
         if (!$absdir) {

-- 
Debian package checker


Reply to: