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

[lintian] 02/06: lintian: Disallow --include-dir/--user-dirs too late



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

nthykier pushed a commit to branch master
in repository lintian.

commit ae5e12585ce89774f2626ff8a343d4181e1999d9
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Mar 17 22:00:36 2014 +0100

    lintian: Disallow --include-dir/--user-dirs too late
    
    Signed-off-by: Niels Thykier <niels@thykier.net>
---
 frontend/lintian | 38 +++++++-------------------------------
 1 file changed, 7 insertions(+), 31 deletions(-)

diff --git a/frontend/lintian b/frontend/lintian
index 961f1d7..c431170 100755
--- a/frontend/lintian
+++ b/frontend/lintian
@@ -451,35 +451,11 @@ sub record_quiet {
     return;
 }
 
-{
-    my $warned = 0;
-
-    sub warn_late_options {
-        print STDERR join(q{ },
-            'Warning: --include-dir and --[no-]user-dirs',
-            "should be the first option(s) if given\n");
-        return;
-    }
-
-    # Process --include-dir (late)
-    sub record_include_dir_late {
-        my (undef, $dir) = @_;
-        push(@search_dirs, $dir);
-        if (not $warned++) {
-            warn_late_options();
-        }
-        return;
-    }
-
-    # Process --[no-]user-dirs (late)
-    sub record_user_dirs_late {
-        my (undef, $value) = @_;
-        $opt{'user-dirs'} = $value;
-        if (not $warned++) {
-            warn_late_options();
-        }
-        return;
-    }
+sub record_option_too_late {
+    print STDERR join(q{ },
+        'Warning: --include-dir and --[no-]user-dirs',
+        "should be the first option(s) if given\n");
+    exit(2);
 }
 
 # Process display-info and display-level options in cfg files
@@ -610,8 +586,8 @@ my %opthash = (
 
     'jobs|j:i' => \$opt{'jobs'},
     'ignore-lintian-env' => \$opt{'ignore-lintian-env'},
-    'include-dir=s' => \&record_include_dir_late,
-    'user-dirs!' => \&record_user_dirs_late,
+    'include-dir=s' => \&record_option_too_late,
+    'user-dirs!' => \&record_option_too_late,
 
     # ------------------ package selection options
     'all|a' => \$check_everything,

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


Reply to: