diff options
author | B. Watson <urchlay@slackware.uk> | 2023-12-23 01:54:26 -0500 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-12-23 01:54:45 -0500 |
commit | e930dd2b0b82d133176e93a6a9855ac2a2d367c8 (patch) | |
tree | 4f15cb2ffe9d3225476c7b67c0bf70d2bcd3c9b1 /sbolint | |
parent | 20f713c2feaacedc150fc46531bfd9f409f2ed9c (diff) | |
download | sbo-maintainer-tools-e930dd2b0b82d133176e93a6a9855ac2a2d367c8.tar.gz |
Update NEWS; sbolint: check for CRLF in *.diff, *.patch.
Diffstat (limited to 'sbolint')
-rwxr-xr-x | sbolint | 31 |
1 files changed, 29 insertions, 2 deletions
@@ -291,6 +291,22 @@ cache must be checked before this command is run. =back +=item - + +Image files are checked for permissions (0644), filename (extension +must match filetype, e.g. a GIF image must not be named image.jpg), +and correctness (must not be truncated/corrupt). + +=item - + +Patch files (anything named *.diff or *.patch) are checked for +permissions (0644) and DOS/Windows CRLF line endings. If a patch +file has CRLF endings, it B<cannot> be checked into SBo's repository, +because git will strip the CR (\r) from every line, meaning the patch +will fail to apply. In this case, the best solution is to gzip the +patch, and have the SlackBuild use e.g. "zcat $CWD/blah.diff.gz | +patch -p1" to apply it. + =back =head1 EXIT STATUS @@ -721,6 +737,7 @@ sub run_checks { \&check_script, \&check_doinst, \&check_images, + \&check_patches, \&check_empty_hidden, ); @@ -785,7 +802,14 @@ sub check_and_read { } } - log_error("$file has DOS-style CRLF line endings") if $crlf_err; + if($crlf_err) { + if($file =~ /\.(diff|patch)$/i) { + log_error("$file has DOS-style CRLF line endings, git will mess it up unless you gzip it!") if $crlf_err; + } else { + log_error("$file has DOS-style CRLF line endings") if $crlf_err; + } + } + log_error("$file has no newline at EOF") if $lastline_nonl; return @lines; } @@ -1738,8 +1762,11 @@ sub check_junkfiles { # if anything *.diff or *.patch contains \r, warn the # user about git stripping the \r's (better gzip it). +# 20231223 bkw: this check relies on check_and_read special-casing +# filenames ending in *.diff or *.patch. sub check_patches { - for(<*.diff>,<*.patch>) { + my $patches = `find . \\( -iname '*.diff' -o -iname '*.patch' \\) -print0`; + for(split /\x00/, $patches) { check_and_read($_, 0644); } } |