summaryrefslogtreecommitdiffstats
path: root/debian/bin/git-tag-gpg-wrapper
blob: 9982b014082c5788439c95a32d38454a2e5a683c (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
#!/bin/bash -e

# Instead of calling gpg, call gpgv and provide a local keyring

debian_dir="$(readlink -f "$(dirname "$0")/..")"

# Parse the expected options.  If the next two lines are combined, a
# failure of getopt won't cause the script to exit.
ordered_args="$(getopt -n "$0" -o "" -l "status-fd:" -l "keyid-format:" -l "verify" -- "$@")"
eval "set -- $ordered_args"
gpgv_opts=()
while true; do
    case "$1" in
	--status-fd)
	    gpgv_opts+=(--status-fd $2)
	    shift 2
	    ;;
	--keyid-format)
	    # ignore
	    shift 2
	    ;;
	--verify)
	    # ignore
	    shift 1
	    ;;
	--)
	    shift 1
	    break
	    ;;
    esac
done

exec gpgv "${gpgv_opts[@]}" --keyring "$debian_dir/upstream/${DEBIAN_KERNEL_KEYRING:-signing-key.pgp}" -- "$@"