[SCM] Git repository for devscripts branch, master, updated. v2.12.4-43-g227b8b8

Benjamin Drung bdrung at debian.org
Thu Oct 25 20:17:03 UTC 2012


The following commit has been merged in the master branch:
commit 114ab89de3a2beb8a0a2e4917536d3ecb433587c
Author: Raphael Geissert <geissert at debian.org>
Date:   Fri Oct 19 18:34:39 2012 -0500

    checkbashisms: allow -FOO- as heredoc delimiter
    
    Signed-off-by: Benjamin Drung <bdrung at debian.org>

diff --git a/scripts/checkbashisms.pl b/scripts/checkbashisms.pl
index cb19ad3..9ebc3f7 100755
--- a/scripts/checkbashisms.pl
+++ b/scripts/checkbashisms.pl
@@ -366,9 +366,11 @@ foreach my $filename (@ARGV) {
 	    # $cat_line contains the version of the line we'll check
 	    # for heredoc delimiters later. Initially, remove any
 	    # spaces between << and the delimiter to make the following
-	    # updates to $cat_line easier.
+	    # updates to $cat_line easier. However, don't remove the
+	    # spaces if the delimiter starts with a -, as that changes
+	    # how the delimiter is searched.
 	    my $cat_line = $line;
-	    $cat_line =~ s/(<\<-?)\s+/$1/g;
+	    $cat_line =~ s/(<\<-?)\s+(?!-)/$1/g;
 
 	    # Ignore anything inside single quotes; it could be an
 	    # argument to grep or the like.
@@ -413,7 +415,7 @@ foreach my $filename (@ARGV) {
 
 	    # Only look for the beginning of a heredoc here, after we've
 	    # stripped out quoted material, to avoid false positives.
-	    if ($cat_line =~ m/(?:^|[^<])\<\<(\-?)\s*(?:[\\]?(\w+)|[\'\"](.*?)[\'\"])/) {
+	    if ($cat_line =~ m/(?:^|[^<])\<\<(\-?)\s*(?:[\\]?([\w-]+)|[\'\"](.*?)[\'\"])/) {
 		$cat_indented = ($1 && $1 eq '-')? 1 : 0;
 		$cat_string = $2;
 		$cat_string = $3 if not defined $cat_string;

-- 
Git repository for devscripts



More information about the devscripts-devel mailing list