]> git.decadent.org.uk Git - dak.git/blob - scripts/debian/update-bugdoctxt
daklib/rm.py: acquire an advisory lock when writing to file
[dak.git] / scripts / debian / update-bugdoctxt
1 #!/bin/bash
2
3 set -e
4
5 export SCRIPTVARS=/srv/ftp-master.debian.org/dak/config/debian/vars
6 . $SCRIPTVARS
7
8 export TERM=linux
9
10 destdir=$ftpdir/doc
11 urlbase=https://www.debian.org/Bugs/
12
13 cd $destdir
14
15 convert () {
16         src=$1; dst=$2
17         rm -f .new-$dst
18         echo Generating $dst from https://www.debian.org/Bugs/$src ...
19         sudo -u dak-unpriv SSL_CERT_FILE=/etc/ssl/ca-debian/ca-certificates.crt lynx -nolist -dump $urlbase$src | sed -e 's/^ *$//' | perl -00 -ne 'exit if /Back to the Debian Project homepage/; print unless ($.==1 || $.==2 || $.==3 || /^\s*Other BTS pages:$/m)' >.new-$dst
20         if cmp -s .new-$dst $dst ; then rm -f .new-$dst
21         else mv -f .new-$dst $dst
22         fi
23 }
24
25 convert Reporting.html bug-reporting.txt
26 convert Access.html bug-log-access.txt
27 convert server-request.html bug-log-mailserver.txt
28 convert Developer.html bug-maint-info.txt
29 convert server-control.html bug-maint-mailcontrol.txt
30 convert server-refcard.html bug-mailserver-refcard.txt