Meta/MaintNotes: post 2.4 update
[git.git] / RelSign
blob66fd3fd05c0986d77ace5d984b23e1bd58d495a5
1 #!/bin/sh
3 # Use agent
4 GPG_TTY=$(tty) &&
5 export GPG_TTY &&
6 eval $(gpg-agent --daemon) &&
7 GPG_AGENT_PID=$(expr "$GPG_AGENT_INFO" : ".*:\([1-9][0-9]*\):[1-9][0-9]*$") &&
8 trap 'kill -0 2>/dev/null $GPG_AGENT_PID && kill $GPG_AGENT_PID' 0 1 2 3 15 &&
9 kill -0 "$GPG_AGENT_PID" &&
10 gpg="gpg --use-agent --local-user 96AFE6CB!" || exit
12 formats='htmldocs manpages'
14 products () {
15 with_sig=: with_src=echo
16 case "$1" in
17 with-sig)
18 with_sig=echo
19 shift
21 only-sig)
22 with_sig=echo with_src=:
23 shift
25 esac
26 version=$1
27 $with_src "git-$version.tar.gz"
28 $with_sig "git-$version.tar.sig"
29 for fmt in $formats
31 $with_src "git-$fmt-$version.tar.gz"
32 $with_sig "git-$fmt-$version.tar.sig"
33 done
36 report () {
37 ls -l "git-$1.sign" $(products with-sig "$1")
41 failed=
42 for tar in git-[0-9]*.tar.gz
44 version=$(expr "$tar" : 'git-\(.*\)\.tar.gz$')
46 if test -f "git-$version.tar.sig"
47 then
48 can_skip=yes
49 for file in $(products with-sig "$version")
51 if ! test -f "$file"
52 then
53 can_skip=no
54 break
56 done
57 if test "$can_skip" = yes
58 then
59 report "$version"
60 continue
64 rm -f $(products only-sig $version)
66 files="$tar"
67 missing=
68 for fmt in $formats
70 doc="git-$fmt-$version.tar.gz"
71 if test -f "$doc"
72 then
73 files="$files $doc"
74 else
75 missing="$missing $doc"
77 done
78 case "$missing" in
79 ?*)
80 echo >&2 "Missing files: $missing"
81 failed="$failed $version"
82 continue
84 esac
85 sha1sum $files | $gpg --clearsign >git-$version.sign || {
86 failed="$failed $version"
87 continue
90 for file in $files
92 gzip -dc <"$file" >"${file%.gz}" &&
93 $gpg -b "${file%.gz}" || {
94 failed="$failed $version"
95 rm -f "${file%.gz}.sig"
97 rm -f "${file%.gz}"
98 done
100 case " $failed " in
101 *" $version "*)
102 continue
104 esac
106 report "$version"
107 done
109 kill $GPG_AGENT_PID