1 # log something (basically echo it together with a timestamp)
3 # Set $PROGRAM to a string to have it added to the output.
5 if [ -z "${PROGRAM}" ]; then
6 echo "$(date +"%b %d %H:%M:%S") $(hostname -s) [$$] $@"
8 echo "$(date +"%b %d %H:%M:%S") $(hostname -s) ${PROGRAM}[$$]: $@"
12 # log the message using log() but then also send a mail
13 # to the address configured in MAILTO (if non-empty)
14 function log_error () {
16 if [ -z "${MAILTO}" ]; then
17 echo "$@" | mail -e -s "[$PROGRAM@$(hostname -s)] ERROR [$$]" ${MAILTO}
21 # debug log, only output when DEBUG=1
23 if [ $DEBUG -eq 1 ]; then
28 # used by cron.dinstall *and* cron.unchecked.
29 function make_buildd_dir () {
31 apt-ftparchive -qq -o APT::FTPArchive::Contents=off generate apt.conf.buildd
35 apt-ftparchive -qq -o APT::FTPArchive::Release::Origin="Debian" -o APT::FTPArchive::Release::Label="Debian" -o APT::FTPArchive::Release::Description="buildd incoming" -o APT::FTPArchive::Release::Architectures="${archs}" release buildd > Release
36 gpg --secret-keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/secring.gpg --keyring /srv/ftp.debian.org/s3kr1t/dot-gnupg/pubring.gpg --no-options --batch --no-tty --armour --default-key 6070D3A1 --detach-sign -o Release.gpg Release
40 mkdir -p tree/${STAMP}
41 cp -al ${incoming}/buildd/. tree/${STAMP}/
42 ln -sfT tree/${STAMP} ${incoming}/builddweb
43 find ./tree -mindepth 1 -maxdepth 1 -not -name "${STAMP}" -type d -print0 | xargs --no-run-if-empty -0 rm -rf