~ubuntu-branches/ubuntu/edgy/git-core/edgy-backports

« back to all changes in this revision

Viewing changes to git-verify-tag.sh

  • Committer: Package Import Robot
  • Author(s): LaMont Jones
  • Date: 2007-11-29 07:28:44 UTC
  • mfrom: (8.1.2 dapper-backports)
  • Revision ID: package-import@ubuntu.com-20071129072844-umsb7y3140yhxkth
Tags: 1:1.5.3.6-1.1~dapper1
* backport to dapper et al.
  - debian/rules changes to support source:Upstream-Version for old dpkg.
  - allow asciidoc (>7.0.2-3)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
USAGE='<tag>'
4
 
SUBDIRECTORY_OK='Yes'
5
 
. git-sh-setup
6
 
 
7
 
verbose=
8
 
while case $# in 0) break;; esac
9
 
do
10
 
        case "$1" in
11
 
        -v|--v|--ve|--ver|--verb|--verbo|--verbos|--verbose)
12
 
                verbose=t ;;
13
 
        *)
14
 
                break ;;
15
 
        esac
16
 
        shift
17
 
done
18
 
 
19
 
if [ "$#" != "1" ]
20
 
then
21
 
        usage
22
 
fi
23
 
 
24
 
type="$(git-cat-file -t "$1" 2>/dev/null)" ||
25
 
        die "$1: no such object."
26
 
 
27
 
test "$type" = tag ||
28
 
        die "$1: cannot verify a non-tag object of type $type."
29
 
 
30
 
case "$verbose" in
31
 
t)
32
 
        git-cat-file -p "$1" |
33
 
        sed -n -e '/^-----BEGIN PGP SIGNATURE-----/q' -e p
34
 
        ;;
35
 
esac
36
 
 
37
 
git-cat-file tag "$1" >"$GIT_DIR/.tmp-vtag" || exit 1
38
 
cat "$GIT_DIR/.tmp-vtag" |
39
 
sed '/-----BEGIN PGP/Q' |
40
 
gpg --verify "$GIT_DIR/.tmp-vtag" - || exit 1
41
 
rm -f "$GIT_DIR/.tmp-vtag"
42