]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/buildd-prepare-dir
add the new keyrings to the queueds
[dak.git] / scripts / debian / buildd-prepare-dir
1 #!/bin/bash
2 # No way I try to deal with a crippled sh just for POSIX foo.
3
4 # Copyright (C) 2011 Joerg Jaspert <joerg@debian.org>
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; version 2.
9 #
10 # This program is distributed in the hope that it will be useful, but
11 # WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 # General Public License for more details.
14 #
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19
20 # exit on errors
21 set -e
22 # make sure to only use defined variables
23 set -u
24 # ERR traps should be inherited from functions too.
25 set -E
26
27 # import the general variable set.
28 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
29 . $SCRIPTVARS
30
31 # And use one locale, no matter what the caller has set
32 export LANG=C
33 export LC_ALL=C
34 PROGRAM="buildd-prepare-dir"
35
36 # common functions are "outsourced"
37 . "${configdir}/common"
38
39 # should be relative to the general base dir later
40 COPYTARGET="${base}/keyrings"
41 GNUPGHOME="${base}/s3kr1t/dot-gnupg"
42 base="${base}/scripts/builddkeyrings"
43 TARGET="${base}/keyrings"
44 REMOVED="${base}/removed-buildd-keys.gpg"
45
46 mkdir -p "${TARGET}/keyrings"
47
48 for arch in $archs; do
49     if [ -f ${base}/${arch}/keyring.gpg ]; then
50         cp -afl ${base}/${arch}/keyring.gpg ${TARGET}/buildd-keyrings/buildd-${arch}-keyring.gpg
51         chmod 0644 ${TARGET}/buildd-keyrings/buildd-${arch}-keyring.gpg
52     fi
53 done
54
55 cd ${TARGET}
56 sha512sum buildd-keyrings/* > sha512sums
57
58 rm -f ${TARGET}/sha512sums.txt
59 SIGNINGKEY=B1326A8D
60 GNUPGHOME=${GNUPGHOME} gpg --no-options  --batch --no-tty --armour --default-key ${SIGNINGKEY} --clearsign -o "${TARGET}/sha512sums.txt" "${TARGET}/sha512sums"
61 rm -f ${TARGET}/sha512sums