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
33 # And use one locale, no matter what the caller has set
36 PROGRAM="buildd-prepare-dir"
38 # common functions are "outsourced"
39 . "${configdir}/common"
41 # should be relative to the general base dir later
42 COPYTARGET="${base}/keyrings"
43 GNUPGHOME="${base}/s3kr1t/dot-gnupg"
44 base="${base}/scripts/builddkeyrings"
45 TARGET="${base}/keyrings"
46 REMOVED="${base}/removed-buildd-keys.gpg"
48 mkdir -p "${TARGET}/keyrings"
50 for arch in $archs; do
51 if [ -f ${base}/${arch}/keyring.gpg ]; then
52 cp -al ${base}/${arch}/keyring.gpg ${TARGET}/keyrings/buildd-${arch}-keyring.gpg
53 chmod 0644 ${TARGET}/keyrings/buildd-${arch}-keyring.gpg
58 sha512sum keyrings/* > sha512sums
60 rm -f ${TARGET}/sha512sums.txt
62 GNUPGHOME=${GNUPGHOME} gpg --no-options --batch --no-tty --armour --default-key ${SIGNINGKEY} --clearsign -o "${TARGET}/sha512sums.txt" "${TARGET}/sha512sums"
63 rm -f ${TARGET}/sha512sums