weekly.functions 981 B

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