]> git.decadent.org.uk Git - dak.git/commitdiff
make the export dir for (o-)p-u-new a bit more atomic
authorJoerg Jaspert <joerg@debian.org>
Sun, 12 Aug 2012 20:12:09 +0000 (22:12 +0200)
committerJoerg Jaspert <joerg@debian.org>
Sun, 12 Aug 2012 20:12:09 +0000 (22:12 +0200)
Signed-off-by: Joerg Jaspert <joerg@debian.org>
config/debian/common

index 66a5f29f0fff5f6f32adc41265d96c264ea06b73..d16d2855a8587f6edabbbbcba418a9126881a18f 100644 (file)
@@ -89,9 +89,11 @@ function punew_do() {
 
     dak generate-packages-sources2 -s "${queue}"
 
-    local exportdir="${queuedir}/${qdir}/export"
-    rm -rf "${exportdir}"
+    local exportdir="${queuedir}${qdir}/tree/${STAMP}"
+    local targetdir="${queuedir}${qdir}/export"
     dak export -q "${queue}" -d "${exportdir}" --all
+    ln -sfT ${targetdir} ${exportdir}
+    find ${queuedir}${qdir}/tree -mindepth 1 -maxdepth 1 -not -name "${STAMP}" -type d -print0 | xargs --no-run-if-empty -0 rm -rf
 }
 
 # These versions used in dinstall