[SCM] Debian package checker branch, vendor-profile, updated. 2.5.1-23-g4e990e7
The following commit has been merged in the vendor-profile branch:
commit 4e990e74f530a299881c766ae012bbdf6ceef0c6
Author: Niels Thykier <niels@thykier.net>
Date: Tue Jun 21 23:26:25 2011 +0200
Added internal testsuite env var to keep the test untainted
Setting LINTIAN_INTERNAL_TESTSUITE to 1 will make lintian skip
the normal profile include path to ensure the tests are not
tainted by user or system profiles.
diff --git a/frontend/lintian b/frontend/lintian
index f7b674c..5335567 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -28,14 +28,6 @@ use warnings;
use Getopt::Long;
use Cwd;
-# The profile search path except LINTIAN_ROOT/profiles
-# which will be added later (we dont know LINTIAN_ROOT
-# at this point)
-use constant PROFILE_PATH => (
- "$ENV{HOME}/.lintian/profiles",
- '/etc/lintian/profiles'
- );
-
# }}}
# {{{ Global Variables
@@ -73,6 +65,14 @@ my $no_conf = 0; #flag for --no-cfg
my %opt; #hash of some flags from cmd or cfg
my %conf_opt; #names of options set in the cfg file
+# The profile search path except LINTIAN_ROOT/profiles
+# which will be added later (we dont know LINTIAN_ROOT
+# at this point)
+my @prof_inc = (
+ "$ENV{HOME}/.lintian/profiles",
+ '/etc/lintian/profiles'
+);
+
my $experimental_output_opts = undef;
my @severities = qw(wishlist minor normal important serious);
@@ -640,6 +640,12 @@ foreach (('ROOT', 'CFG', VARS)) {
}
}
+# If we are running the test suite we should ignore
+# user/system profiles.
+if ($ENV{'LINTIAN_INTERNAL_TESTSUITE'}){
+ @prof_inc = ();
+}
+
$verbose = 1 if $debug;
$ENV{'LINTIAN_DEBUG'} = $debug;
@@ -742,7 +748,7 @@ if (defined $check_tags || %suppress_tags) {
if ($LINTIAN_PROFILE) {
my $profile = Lintian::Profile->new($LINTIAN_PROFILE,
- [PROFILE_PATH, "$LINTIAN_ROOT/profiles"]);
+ [@prof_inc, "$LINTIAN_ROOT/profiles"]);
my @ptags = $profile->tags;
my @ign_overrides = $profile->ignored_overrides;
my $severities = $profile->severity_changes;
@@ -1265,7 +1271,7 @@ sub find_default_profile {
while ($vendor) {
my $p;
v_msg("Checking for default profile for $vendor.");
- $p = Lintian::Profile->find_profile(lc($vendor), PROFILE_PATH, "$LINTIAN_ROOT/profiles");
+ $p = Lintian::Profile->find_profile(lc($vendor), @prof_inc, "$LINTIAN_ROOT/profiles");
last if $p;
$vendor = $qparent->($vendor);
}
diff --git a/private/runtests b/private/runtests
index 7d98eae..1bf4491 100755
--- a/private/runtests
+++ b/private/runtests
@@ -18,12 +18,14 @@ fi
LANG="en_US.UTF-8"
LC_COLLATE="C"
LINTIAN_ROOT=""
+LINTIAN_INTERNAL_TESTSUITE=1
LOCPATH="$(pwd)/debian/test.locale"
NO_PKG_MANGLE=true
export LANG
export LC_COLLCATE
export LINTIAN_ROOT
+export LINTIAN_INTERNAL_TESTSUITE
export LOCPATH
export NO_PKG_MANGLE
--
Debian package checker
Reply to: