diff options
author | B. Watson <urchlay@slackware.uk> | 2023-09-16 16:48:04 -0400 |
---|---|---|
committer | B. Watson <urchlay@slackware.uk> | 2023-09-16 16:48:04 -0400 |
commit | a69bdc0ef63343373773995f7e87d11a29ed4259 (patch) | |
tree | f5974b6a55412a6729195e87879b0c3d46ade24f /sbopkglint | |
parent | 23fac95b672fe55feb248e8101bc3fb63c3b0970 (diff) | |
download | sbo-maintainer-tools-a69bdc0ef63343373773995f7e87d11a29ed4259.tar.gz |
sbopkglint: refactor gzip detection.
Diffstat (limited to 'sbopkglint')
-rwxr-xr-x | sbopkglint | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -584,6 +584,12 @@ find_warnfiles() { rm -f $output } +# return true if the file is gzipped, otherwise false. +# faster than using file(1). +is_gzipped() { + [ "$( hexdump -n 2 -e '"%2x"' "$1" )" = '8b1f' ] +} + # N.B. these need to match the template (and they do) TMP=${TMP:-/tmp/SBo} OUTPUT=${OUTPUT:-/tmp} |