summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xconf/master.conf.example1
-rwxr-xr-xlib/common-functions6
-rwxr-xr-xlib/load-configuration1
3 files changed, 8 insertions, 0 deletions
diff --git a/conf/master.conf.example b/conf/master.conf.example
index f2a3bcf..4ec36f8 100755
--- a/conf/master.conf.example
+++ b/conf/master.conf.example
@@ -14,6 +14,7 @@
# to access the master mirror via sftp
#master_mirror_sftp_command='sftp -b- user@mirror'
+#master_mirror_sftp_root='mirror.archlinux32.org'
# root directory of the webserver
#webserver_directory='/srv/http'
diff --git a/lib/common-functions b/lib/common-functions
index 110578f..b64af00 100755
--- a/lib/common-functions
+++ b/lib/common-functions
@@ -871,6 +871,12 @@ failsafe_sftp() {
trial_counter=20
trap 'rm -rf --one-file-system "${temp_dir}"' EXIT
cat > "${temp_dir}/input"
+ if [ -n "${master_mirror_sftp_root}" ]; then
+ sed -i '
+ /^\(rm\|rename\) / s@"\([^"]\+\)"@"'"${master_mirror_sftp_root}"'/\1"@g
+ /^ln / s@"\([^"]\+\)"$@"'"${master_mirror_sftp_root}"'/\1"@
+ ' "${temp_dir}/input"
+ fi
sed -n '
s/^rm "\([^"]\+\)"$/- \1/
s/^ln\( [^"]\S*\)* "[^"]\+" "\([^"]\+\)"$/+ \2/
diff --git a/lib/load-configuration b/lib/load-configuration
index 2796d00..eb9ad1e 100755
--- a/lib/load-configuration
+++ b/lib/load-configuration
@@ -93,6 +93,7 @@ master_mirror_rsync_directory='rsync://buildmaster@mirror.archlinux32.org/packag
# to access the master mirror via sftp
master_mirror_sftp_command='sftp -b- user@mirror'
+master_mirror_sftp_root='mirror.archlinux32.org'
# mirror of sources, identified (solely) by hash
source_by_hash_mirror='https://sources.archlinux32.org/'