exigrep: use a pager if stdout is connected to a terminal
[exim.git] / release-process / scripts / stats_for_email
CommitLineData
00f7a87b
PP
1#!/bin/sh -eu
2
3okay=false
4if [ -d ../../release-process ] && [ "${PWD##*/}" = "pkgs" ]; then
5 okay=true # we are in right dir
6elif [ -d release-process ]; then
7 b="$(find . -maxdepth 1 -name 'exim-packaging-*' | sort | tail -n 1)"
8 if [ ".$b" != "." ]; then
9 cd "$b/pkgs"
10 okay=true
11 fi
12fi
13if ! $okay; then
14 if [ -d "${1:?need a directory to look in}" ]; then
15 cd "$1"
16 shift
17 else
18 printf "%s: %s\n" >&2 "$(basename "$0")" "where should I be looking"
19 exit 1
20 fi
21fi
22
23set $(find "${1:-.}" -name '*.asc' -prune -o -type f -print | cut -c 3- | sort)
24
25# stat(1) formats are non-portable BSD vs GNU
26perl -le 'print "SIZE($_)= @{[-s $_]}" foreach @ARGV' "$@"
27echo
28openssl dgst -sha256 "$@"