]> git.decadent.org.uk Git - dak.git/blobdiff - config/debian/monthly.functions
Ups, that backports dir is still in use
[dak.git] / config / debian / monthly.functions
index db4de4b85f3971cb4bb758add5261cec997df329..c930f62a5810c2bc7ba1ad8ffdf78d52f421fee7 100644 (file)
@@ -22,4 +22,18 @@ function archivequeuedone() {
     log "Archiving queue/done files of ${DONEYEAR}-${DONEMONTH}"
     cd ${queuedir}/done/${DONEYEAR}
     tar --create --xz --remove-files --file ${DONEMONTH}.tar.xz ${DONEMONTH}
-}
\ No newline at end of file
+}
+
+function rotatereports() {
+    # Do not rotate while it might receive data
+    if lockfile -r -1 ${LOCK_UNCHECKED} 2> /dev/null; then
+        TMPFILES="${TMPFILES} ${LOCK_UNCHECKED}"
+        for dir in ${queuedir}/{.,p-u-new,o-p-u-new} /srv/backports-master.debian.org/queue/policy; do
+            cd ${dir}
+            mv REPORT REPORT.${OLDDATE}
+            xz -9 REPORT.${OLDDATE}
+            touch REPORT
+        done
+    fi
+    rm ${LOCK_UNCHECKED}
+}