summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Jaspert <joerg@debian.org>2008-10-30 22:33:59 +0100
committerJoerg Jaspert <joerg@debian.org>2008-10-30 22:33:59 +0100
commit4f0e46fa9307e00c22ee5b5ddc287286834e0056 (patch)
tree1638ab4c4ee6697eb7a79f33f5c56b3055405eae
parent66d13cffd124e439ef443cf17a40936c90098fe2 (diff)
runmirrors
correctly set PUSHLOCKS Signed-off-by: Joerg Jaspert <joerg@debian.org>
-rwxr-xr-xbin/runmirrors6
-rw-r--r--etc/common11
2 files changed, 12 insertions, 5 deletions
diff --git a/bin/runmirrors b/bin/runmirrors
index 8667a03..c49162a 100755
--- a/bin/runmirrors
+++ b/bin/runmirrors
@@ -84,11 +84,7 @@ hook $HOOK
set +e
# Built up our list of 2-stage mirrors.
-PUSHLOCKS=""
-egrep '^staged' "${MIRRORS}" |
-while read MTYPE MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do
- PUSHLOCKS="${PUSHLOCKS} ${LOCKDIR}/${MLNAME}.stage1"
-done
+PUSHLOCKS=$(get2stage)
# Now read our mirrorfile and push the mirrors defined in there.
# We use grep to easily sort out all lines having a # in front of them or are empty.
diff --git a/etc/common b/etc/common
index 90bf67a..984d695 100644
--- a/etc/common
+++ b/etc/common
@@ -147,3 +147,14 @@ hook () {
return 0
fi
}
+
+# Return the list of 2-stage mirrors.
+get2stage() {
+ egrep '^staged' "${MIRRORS}" | {
+ while read MTYPE MLNAME MHOSTNAME MUSER MPROTO MKEYFILE; do
+ PUSHLOCKS="${LOCKDIR}/${MLNAME}.stage1 ${PUSHLOCKS}"
+ done
+ echo "$PUSHLOCKS"
+ }
+}
+