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 base="${base}/scripts/builddkeyrings"
44 TARGET="${base}/keyrings"
45 REMOVED="${base}/removed-buildd-keys.gpg"
47 mkdir -p "${TARGET}/keyrings"
49 for arch in $archs; do
50 if [ -f ${base}/${arch}/keyring.gpg ]; then
51 cp -al ${base}/${arch}/keyring.gpg ${TARGET}/keyrings/buildd-${arch}-keyring.gpg
52 chmod 0644 ${TARGET}/keyrings/buildd-${arch}-keyring.gpg
57 sha512sum keyrings/* > sha512sums
59 rm -f ${TARGET}/sha512sums.txt
60 SIGNINGKEY=$(dak admin c signingkeyids)
61 gpg --no-options --batch --no-tty --armour --default-key ${SIGNINGKEY} --clearsign -o "${TARGET}/sha512sums.txt" "${TARGET}/sha512sums"
62 rm -f ${TARGET}/sha512sums