summaryrefslogtreecommitdiff
path: root/support/dependencies/check-host-gzip.sh
blob: 5f344c5f9b7dddaf42fe4c72b48c2b589122e266 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/sh

candidate="$1" # ignored

gzip="$(which gzip)"
if [ ! -x "${gzip}" ]; then
    # echo nothing: no suitable gzip found
    exit 1
fi

# gzip displays its version string on stdout
# pigz displays its version string on stderr
version="$("${gzip}" --version 2>&1)"
case "${version}" in
  (*pigz*)
    # echo nothing: no suitable gzip found
    exit 1
    ;;
esac

printf "%s" "${gzip}"