]> git.deb.at Git - deb/packages.git/blob - cron.d/300extract_changelogs
Finally fix the new packages rss feed
[deb/packages.git] / cron.d / 300extract_changelogs
1 #!/bin/bash
2
3 . `dirname $0`/../config.sh
4  
5 if test -z "${localdir}"; then
6     echo skipping due to missing local archive
7     exit 1
8 fi
9
10 #set -e
11
12 NOCPY_TEMPLATE=$topdir/etc/copyright_error
13 NOCPY_BIN_TEMPLATE=$topdir/etc/copyright_error_bin
14
15 logs="$topdir/files/logs"
16 log="${logs}/changelogs.log"
17
18 test -d "$logs" || mkdir -p "$logs"
19 test -d "$tmpdir" || mkdir -p "$tmpdir"
20
21 if [ -s "$log" ]
22 then
23     savelog -c 14 "$log" > /dev/null
24 fi
25
26 (
27 date
28
29 for part in $parts; do
30     time "${bindir}/extract_files" -v -d "${localdir}/pool/$part/" \
31         -t "${htmldir}/changelogs/pool/$part/" \
32         -c "$configdir" -w "$tmpdir" \
33         --dumpfile "${filesdir}/changelogs.$part.dump" \
34         --cachefile "${filesdir}/changelogs.cache"
35 done
36
37 find "${htmldir}/changelogs/" -name log -cmin +7200 \
38  | while read logfile; do
39         dir=$(dirname "$logfile")
40         echo deleting $dir
41         rm -r "$dir"
42         rmdir --ignore-fail-on-non-empty $(dirname "$dir")
43 done
44
45 date
46 ) > $log 2>&1