]> git.decadent.org.uk Git - dak.git/blob - config/debian/daily.functions
Move urgency log from release.d.o to our web dir
[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=$( gettempfile )
7     wget -q -O${TMPLIST} --ca-directory=/etc/ssl/ca-debian https://qa.debian.org/data/bts/wnpp_rm
8     chmod go+r ${TMPLIST}
9     mv ${TMPLIST} ${scriptdir}/masterfiles/wnpp_rm
10 }
11
12 # Push files over to security
13 function pushfilesdb() {
14     log "Pushing files table to security"
15     # The key over there should have the following set for the ssh key:
16     #  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"
17     psql -c 'COPY files (id, filename, size, md5sum, last_used, sha1sum, sha256sum, created, modified) TO STDOUT' projectb | \
18         xz -3 | \
19         ssh -o BatchMode=yes -o ConnectTimeout=30 -o SetupTimeout=30 -2 \
20             -i ${base}/s3kr1t/push_external_files dak@security-master.debian.org sync
21 }
22
23 # Update wanna-build dump
24 function wbdump() {
25     log "Update wanna-build database dump"
26     ${masterdir}/scripts/nfu/get-w-b-db
27 }
28
29
30 # Generate list of override disparities
31 function overridedisp() {
32     log "Generating list of override disparities"
33     dak override-disparity | gzip -9 > ${webdir}/override-disparity.gz
34 }
35
36 # Generate stats about the new queue
37 function newstats() {
38     log "Generating stats about the new queue"
39     dak stats new ${webdir}/NEW-stats.yaml 2> /dev/null
40 }
41
42 # Generate the contributor data
43 function contributor() {
44     log "Submitting data to contributors"
45     TMPCNTB=$( gettempfile )
46     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}
47
48     # Post with curl as a workaround for #801506
49     # See https://wiki.debian.org/ServicesSSL#curl
50     dir=/etc/ssl/ca-debian
51     test -d ${dir} && capath="--capath ${dir}"
52     curl -s ${capath} https://contributors.debian.org/contributors/post \
53          -F source=ftp.debian.org \
54          -F auth_token="$(cat ${base}/s3kr1t/contributor.auth)" \
55          -F data=@${TMPCNTB} > ${TMPCNTB}.result
56     log "Results:"
57     cat ${TMPCNTB}.result
58     log "----"
59     rm -f ${TMPCNTB}.result
60 }
61
62 # Clean up urgency log
63 function cleanurgencylog() {
64     log "Cleaning up urgency log"
65     find /srv/ftp.debian.org/web/britney/urgencies -type -f -mtime +365 -delete
66 }