chiark / gitweb /
git-debrebase: breakwater_of: permit unclean to be an fproblem
[dgit.git] / infra / dgit-mirror-rsync
index 0162042..9346489 100755 (executable)
@@ -26,7 +26,7 @@ set -o pipefail
 shopt -s nullglob
 
 case "$DGIT_DRS_DEBUG" in
-''|0!1)                ;;
+''|0|1)                ;;
 *)             set -x  ;;
 esac
 
@@ -91,7 +91,7 @@ reinvoke () {
 
 check-package-mirrorable () {
        local repo=$repos/$package.git
-       local mode=$(stat -c%a "$repo")
+       local mode; mode=$(stat -c%a "$repo")
        case $mode in
        *5)     return  0       ;;
        *0)     return  1       ;;
@@ -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"
@@ -146,13 +150,13 @@ reinvoke-locked)
 
 backlog)
        for f in $queue/*.[na]; do
-               lock-and-process-baseof-f
+               (lock-and-process-baseof-f ||:)
        done
        ;;
 
 all)
        for f in [a-z0-9]*.git; do
-               lock-and-process-baseof-f
+               (lock-and-process-baseof-f)
        done
        ;;