]> git.decadent.org.uk Git - dak.git/blob - config/debian/daily.functions
3dae2d6d97a0282fc884583371c864213b0d03b0
[dak.git] / config / debian / daily.functions
1 # -*- mode:sh -*-
2
3 # get the latest list of wnpp bugs and their source packages
4 function wnppbugs() {
5     log "Fetching latest list of wnpp bugs"
6     TMPLIST=$( mktemp -p ${TMPDIR} )
7     TMPFILES="${TMPFILES} ${TMPLIST}"
8     wget -q -O${TMPLIST} --ca-directory=/etc/ssl/ca-debian https://qa.debian.org/data/bts/wnpp_rm
9     chmod go+r ${TMPLIST}
10     mv ${TMPLIST} ${scriptdir}/masterfiles/wnpp_rm
11 }
12
13 # Push files over to security
14 function pushfilesdb() {
15     log "Pushing files table to security"
16     # The key over there should have the following set for the ssh key:
17     #  command="/usr/bin/xzcat | /usr/bin/psql -1 -c 'DELETE FROM external_files; COPY external_files (id, filename, size, md5sum, last_used, sha1sum, sha256sum, created, modified) FROM STDIN' obscurity"
18     psql -c 'COPY files (id, filename, size, md5sum, last_used, sha1sum, sha256sum, created, modified) TO STDOUT' projectb | \
19         xz -3 | \
20         ssh -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 \
21             -i ${base}/s3kr1t/push_external_files dak@security-master.debian.org sync
22 }
23
24 # Update wanna-build dump
25 function wbdump() {
26     log "Update wanna-build database dump"
27     ${masterdir}/scripts/nfu/get-w-b-db
28 }
29
30
31 # Generate list of override disparities
32 function overridedisp() {
33     log "Generating list of override disparities"
34     dak override-disparity | gzip -9 > ${webdir}/override-disparity.gz
35 }
36
37 # Generate stats about the new queue
38 function newstats() {
39     log "Generating stats about the new queue"
40     dak stats new ${webdir}/NEW-stats.yaml 2> /dev/null
41 }
42
43 # Generate the contributor data
44 function contributor() {
45     log "Submitting data to contributors"
46     TMPCNTB=$( mktemp -p ${TMPDIR} )
47     TMPFILES="${TMPFILES} ${TMPCNTB}"
48     REQUESTS_CA_BUNDLE=/etc/ssl/ca-debian/ca-certificates.crt dc-tool --mine="${configdir}/contributor.source" --auth-token @"${base}/s3kr1t/contributor.auth" --source ftp.debian.org --json > ${TMPCNTB}
49
50     # Post with curl as a workaround for #801506
51     # See https://wiki.debian.org/ServicesSSL#curl
52     dir=/etc/ssl/ca-debian
53     test -d ${dir} && capath="--capath ${dir}"
54     curl -s ${capath} https://contributors.debian.org/contributors/post \
55          -F source=ftp.debian.org \
56          -F auth_token="$(cat ${base}/s3kr1t/contributor.auth)" \
57          -F data=@${TMPCNTB} > ${TMPCNTB}.result
58     log "Results:"
59     cat ${TMPCNTB}.result
60     log "----"
61     rm -f ${TMPCNTB}.result
62 }