aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xserver/mrrepo37
1 files changed, 23 insertions, 14 deletions
diff --git a/server/mrrepo b/server/mrrepo
index 469a03f..056d101 100755
--- a/server/mrrepo
+++ b/server/mrrepo
@@ -16,6 +16,13 @@
# file. This file should be placed next to and will be sourced by the mrrepo
# script (remember to adjust its permissions).
#
+# If the remote repositories mirroring is enabled (<host> argument is
+# specified), then consider all subdirectories of <path> with the .git
+# extension, except for the local repositories, old mirrored remote
+# repositories and remove them. Note that a git repository is local if it is
+# referred to in the local manifest (public) or doesn't contain the
+# git-daemon-export-ok file (private).
+#
# The manifest file line format (lines starting with # are ignored):
#
# <repository-path>[ <remote-mirror-url>]
@@ -234,23 +241,25 @@ if test -f manifest; then
# Everything that is not in local is mirrored (or local private).
#
- for r in "${all[@]}"; do
-
- for i in "${local[@]}"; do
- if [ "$i" = "$r" ]; then
- if [ "$verb" -ge 1 ]; then
- info "local public repository $r"
+ if [ -n "$host" ]; then
+ for r in "${all[@]}"; do
+
+ for i in "${local[@]}"; do
+ if [ "$i" = "$r" ]; then
+ if [ "$verb" -ge 1 ]; then
+ info "local public repository $r"
+ fi
+ r=
+ break
fi
- r=
- break
+ done
+
+ if [ -n "$r" ]; then
+ mirror+=("$r")
fi
done
-
- if [ -n "$r" ]; then
- mirror+=("$r")
- fi
- done
-else
+ fi
+elif [ -n "$host" ]; then
mirror=("${all[@]}")
fi