[lintian] 09/09: Check syntax of data/scripts/maintainer-script-bad-command
This is an automated email from the git hooks/post-receive script.
broucaries-guest pushed a commit to branch master
in repository lintian.
commit ec468f04f4fa42785171662054c234eb21e5e61f
Author: Bastien ROUCARIÈS <roucaries.bastien@gmail.com>
Date: Sun Dec 8 18:48:22 2013 +0100
Check syntax of data/scripts/maintainer-script-bad-command
Check syntax of data/scripts/maintainer-script-bad-command and fail early.
---
checks/scripts.pm | 6 +++++-
data/scripts/maintainer-script-bad-command | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/checks/scripts.pm b/checks/scripts.pm
index 17b97ec..77f3daa 100644
--- a/checks/scripts.pm
+++ b/checks/scripts.pm
@@ -92,7 +92,11 @@ my $BAD_MAINT_CMD = Lintian::Data->new(
'scripts/maintainer-script-bad-command',
qr/\s*\~\~/,
sub {
- my ($incat,$exceptinpackage,$inscript,$regexp) = split(/\s*\~\~/, $_[1], 4);
+ my @sliptline = split(/\s*\~\~/, $_[1], 4);
+ if(scalar(@sliptline) != 4) {
+ fail 'Syntax error in scripts/maintainer-script-bad-command:', $.;
+ }
+ my ($incat,$exceptinpackage,$inscript,$regexp) = @sliptline;
$regexp =~ s/\${LEADIN}/$LEADINSTR/;
# allow empty $exceptinpackage and set it synonymous to check in all package
$exceptinpackage = defined($exceptinpackage) ? strip($exceptinpackage) : '';
diff --git a/data/scripts/maintainer-script-bad-command b/data/scripts/maintainer-script-bad-command
index 9a55d38..7211d36 100644
--- a/data/scripts/maintainer-script-bad-command
+++ b/data/scripts/maintainer-script-bad-command
@@ -9,7 +9,7 @@
# Use empty string for checking in all package.
# - only in file is a regexp for checking only in some maintainer script
# Empty means check in all files.
-# - regexp is the regexp to check. First group ($1) will be printed if found as extra tag info.
+# - regexp is the regexp to check. First group ($1) will be printed if found as extra tag info
# You could use the special variable ${LEADIN} if needed (see below).
#
# ${LEADIN}:
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/lintian/lintian.git
Reply to: