chiark
/
gitweb
/
~ianmdlvl
/
dgit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
infrastructure: Run git gc --auto before mirroring. Closes:#841414.
[dgit.git]
/
infra
/
dgit-mirror-rsync
diff --git
a/infra/dgit-mirror-rsync
b/infra/dgit-mirror-rsync
index 2858047b57f85307085c1df13f0448d69e29473e..2d912c8ad1dd30f335c2f52d8e4f6011a718a22c 100755
(executable)
--- 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
shopt -s nullglob
case "$DGIT_DRS_DEBUG" in
-''|0
!
1) ;;
+''|0
|
1) ;;
*) set -x ;;
esac
*) set -x ;;
esac
@@
-54,6
+54,7
@@
rsync=(rsync -rltH --safe-links --delete)
hooktimeout=30
rsynctimeout=900
rsyncssh='ssh -o batchmode=yes'
hooktimeout=30
rsynctimeout=900
rsyncssh='ssh -o batchmode=yes'
+mirror_gc_cmd='git gc --auto'
. $distrodir/mirror-settings
. $distrodir/mirror-settings
@@
-74,6
+75,12
@@
case "$remoterepos" in
esac
actually () {
esac
actually () {
+ if [ "x$mirror_gc_cmd" != x ]; then
+ (
+ cd "$repos/$package.git"
+ $mirror_gc_cmd
+ )
+ fi
"${rsync[@]}" \
--timeout=$rsynctimeout \
-e "$rsyncssh" \
"${rsync[@]}" \
--timeout=$rsynctimeout \
-e "$rsyncssh" \
@@
-91,7
+98,7
@@
reinvoke () {
check-package-mirrorable () {
local repo=$repos/$package.git
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 ;;
case $mode in
*5) return 0 ;;
*0) return 1 ;;
@@
-105,13
+112,17
@@
lock-and-process () {
}
attempt () {
}
attempt () {
- exec >"$queue/$package.err" 2>&1
+ exec
3>&2
>"$queue/$package.err" 2>&1
if actually; then
rm -f "$queue/$package.a"
if actually; then
rm -f "$queue/$package.a"
+ exec 2>&3 2>&1
mv -f "$queue/$package.err" "$queue/$package.log"
mv -f "$queue/$package.err" "$queue/$package.log"
+ if ! [ -s "$queue/$package.log" ]; then
+ rm "$queue/$package.log"
+ fi
rm "$queue/$package.lock"
else
rm "$queue/$package.lock"
else
- cat >&
2
"$queue/$package.err"
+ cat >&
3
"$queue/$package.err"
exit 127
fi
}
exit 127
fi
}
@@
-146,13
+157,13
@@
reinvoke-locked)
backlog)
for f in $queue/*.[na]; do
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
done
;;
all)
for f in [a-z0-9]*.git; do
- lock-and-process-baseof-f
+ (lock-and-process-baseof-f)
done
;;
done
;;