diff options
| author | B. Watson <urchlay@slackware.uk> | 2026-09-20 02:52:46 -0400 |
|---|---|---|
| committer | B. Watson <urchlay@slackware.uk> | 2026-09-20 02:52:46 -0400 |
| commit | 2fc3ed484e8e63b827390da8747a51580ce107d9 (patch) | |
| tree | 91d411e4b87e4ce5d280f4d49dbb98717ea9b220 /sbolint | |
| parent | cacfbc91680ecdd9211f95e25050e1aad6c79d70 (diff) | |
| download | sbo-maintainer-tools-2fc3ed484e8e63b827390da8747a51580ce107d9.tar.gz | |
sbolint: check continuations lines in .info file.
Diffstat (limited to 'sbolint')
| -rwxr-xr-x | sbolint | 33 |
1 files changed, 32 insertions, 1 deletions
@@ -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; } |
