chiark / gitweb /
Mirroring: Remove pointless empty .log files
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 18:14:03 +0000 (19:14 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 11 Jul 2015 18:31:26 +0000 (19:31 +0100)
infra/dgit-mirror-rsync
tests/lib-mirror

index 47142ee..0d29ffb 100755 (executable)
@@ -108,7 +108,11 @@ attempt () {
        exec 3>&2 >"$queue/$package.err" 2>&1
        if actually; then
                rm -f "$queue/$package.a"
+               exec 2>&3 2>&1
                mv -f "$queue/$package.err" "$queue/$package.log"
+               if ! [ -s "$queue/$package.log" ]; then
+                       rm "$queue/$package.log"
+               fi
                rm "$queue/$package.lock"
        else
                cat >&3 "$queue/$package.err"
index c84c30c..a61e02b 100644 (file)
@@ -29,7 +29,7 @@ t-check-mirrored () {
        t-reporefs master
        t-reporefs mirror $pmirror
        diff $tmp/show-refs.{master,mirror}
-       cat $queuedir/$p.log
+       cat $queuedir/$p.log ||:
        t-files-notexist $queuedir/$p.{n,a,lock,err}
 }