2 # No way I try to deal with a crippled sh just for POSIX foo.
4 # Copyright (C) 2011 Joerg Jaspert <joerg@debian.org>
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.
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.
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.
22 # make sure to only use defined variables
24 # ERR traps should be inherited from functions too.
27 # import the general variable set.
28 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
31 # And use one locale, no matter what the caller has set
34 PROGRAM="buildd-prepare-dir"
36 # common functions are "outsourced"
37 . "${configdir}/common"
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 STAMPFILE="${base}/updatedkeyring"
47 mkdir -p "${TARGET}/buildd-keyrings"
49 if [ -f "${STAMPFILE}" ]; then
51 for arch in $archs; do
52 if [ -f ${base}/${arch}/keyring.gpg ]; then
53 cp -afl ${base}/${arch}/keyring.gpg ${TARGET}/buildd-keyrings/buildd-${arch}-keyring.gpg
54 chmod 0644 ${TARGET}/buildd-keyrings/buildd-${arch}-keyring.gpg
59 sha512sum buildd-keyrings/* > sha512sums
61 rm -f ${TARGET}/sha512sums.txt
63 GNUPGHOME=${GNUPGHOME} gpg --no-options --batch --no-tty --armour --default-key ${SIGNINGKEY} --clearsign -o "${TARGET}/sha512sums.txt" "${TARGET}/sha512sums"
64 rm -f ${TARGET}/sha512sums