X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=blobdiff_plain;f=infra%2Fdgit-mirror-rsync;h=93464892e54137c496f56548ef450d6581c8cb94;hp=0fcc5f1943a019a3f28c250f657fa25dc7d9ba28;hb=dd16a85d0df7e5b55a49b1c80aa769946f1ebb21;hpb=1a404d721066ea64a938b2e26ec397f458f74bb8 diff --git a/infra/dgit-mirror-rsync b/infra/dgit-mirror-rsync index 0fcc5f19..93464892 100755 --- a/infra/dgit-mirror-rsync +++ b/infra/dgit-mirror-rsync @@ -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"