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