aboutsummaryrefslogtreecommitdiff
path: root/sbopkglint
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2023-09-16 16:48:04 -0400
committerB. Watson <urchlay@slackware.uk>2023-09-16 16:48:04 -0400
commita69bdc0ef63343373773995f7e87d11a29ed4259 (patch)
treef5974b6a55412a6729195e87879b0c3d46ade24f /sbopkglint
parent23fac95b672fe55feb248e8101bc3fb63c3b0970 (diff)
downloadsbo-maintainer-tools-a69bdc0ef63343373773995f7e87d11a29ed4259.tar.gz
sbopkglint: refactor gzip detection.
Diffstat (limited to 'sbopkglint')
-rwxr-xr-xsbopkglint6
1 files changed, 6 insertions, 0 deletions
diff --git a/sbopkglint b/sbopkglint
index fd458c4..2e86174 100755
--- a/sbopkglint
+++ b/sbopkglint
@@ -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}