summaryrefslogtreecommitdiff
path: root/Master/tlpkg/bin/tlgpg
blob: 624c61e4ec7330345cde55e47789c298e1cbb607 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/sh
# $Id$
# Public domain. Originally written 2016, Norbert Preining.
# Run a gpg command for TeX Live, that is, with the TL --homedir, etc.
# Since we want to be able to independently sign and verify, factor this out.

if test $# -eq 0; then
  echo "$0: At least one argument must be given." >&2
  exit 1
fi

gpg_prog=gpg
gpg_opts="--batch --homedir /home/texlive/.gnupg  \
  --passphrase-file /home/texlive/.gnupg/passphrase \
  --local-user 0x06BAB6BC "

# use the environment variables if set. This is for testing;
# we don't define them in normal usage.
if test -n "$TL_GNUPG"; then
  gpg_prog=$TL_GNUPG
fi
if test -n "$TL_GNUPGOPTS"; then
  gpg_opts=$TL_GNUPGOPTS
fi

if $gpg_prog $gpg_opts "$@" </dev/null; then
  :
else
  echo "$0: gpg failed; command was:" >&2
  echo "$0:   $gpg_prog $gpg_opts" "$@" >&2
  exit 1
fi

exit 0