From 2fc3ed484e8e63b827390da8747a51580ce107d9 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 20 Sep 2026 02:52:46 -0400 Subject: sbolint: check continuations lines in .info file. --- sbolint | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) (limited to 'sbolint') diff --git a/sbolint b/sbolint index c9f65bc..131380f 100755 --- a/sbolint +++ b/sbolint @@ -303,6 +303,20 @@ request (see the B<-u> option). =item - +For DOWNLOAD, DOWNLOAD_x86_64, MD5SUM, and MD5SUM_x86_64, if there are +multiple values (URLs or md5sums), they must appear on separate lines, +with B<\> at the end of each line but the last. + +=item - + +For PRGNAM, VERSION, HOMEPAGE, REQUIRES, MAINTAINER, and EMAIL, +breaking up the value across multiple lines with B<\> is not +allowed. The only one of these that accepts multiple values is +REQUIRES, anyway. Various scripts have been written that parse .info +files and would break if REQUIRES were split. + +=item - + If there is a doinst.sh script: =over 4 @@ -1107,7 +1121,21 @@ sub check_info { my $fixable = 0; - # parse and bitch about bad syntax... + # pass 1: just check for continuations. keys that have multiple + # values *must* be broken up with \ (not all on one line with spaces). + for(@lines) { + $lineno++; + next unless /^(DOWNLOAD(?:_x86_64)?|MD5SUM(?:_x86_64)?)/; + my $k = $1; + if(/\s\s/) { + log_warning("$file:$lineno: $k has sequences of multiple spaces; collapse them into one"); + } elsif (/\s[^\\]/) { + log_error("$file:$lineno: $k has multiple values and must be split into multiple lines with \\"); + } + } + + # pass 2: parse and bitch about bad syntax... + $lineno = 0; for(@lines) { $lineno++; if($continuation) { @@ -1117,6 +1145,9 @@ sub check_info { } if(s/\s*\\$//) { + if(/^(PRGNAM|VERSION|HOMEPAGE|REQUIRES|MAINTAINER|EMAIL)/) { + log_error("$file:$lineno: $1 may not be broken up into multiple lines with \\"); + } $continuation = $_; next; } -- cgit v1.2.3