]> git.decadent.org.uk Git - dak.git/blob - config/debian/weekly.functions
Various
[dak.git] / config / debian / weekly.functions
1 # -*- mode:sh -*-
2
3 function purgeempty() {
4     log "Purging empty directories"
5     local archiveroot
6
7     for archive in "${public_archives[@]}"; do
8         log "... archive: ${archive}"
9         archiveroot="$(get_archiveroot "${archive}")"
10
11         # FIXME: double find
12         if [ ! -z "$(find ${archiveroot}/pool/ -type d -empty)" ]; then
13             find ${archiveroot}/pool/ -type d -empty | xargs rmdir;
14         fi
15     done
16 }
17
18 function gitcleanup() {
19     log "Doing git stuff"
20     cd ${public}/git/dak.git
21     git gc --prune
22     git update-server-info
23     # now workaround a git bug not honoring the setup in logs/*
24     # (fix in development, but until it reached backports.org.......)
25     chmod -R g+w logs/
26 }
27
28 function fixsymlinks() {
29     log "Fixing symlinks"
30     local archiveroot
31
32     for archive in "${public_archives[@]}"; do
33         log "... archive: ${archive}"
34         archiveroot="$(get_archiveroot "${archive}")"
35         symlinks -d -r ${archiveroot}
36     done
37 }
38
39 function linkmorgue() {
40     ${scriptsdir}/link_morgue.sh
41 }