11b5865dc1
This reverts commit 1b457a5d85
.
It wasn't prudent to switch everyone to master FTP server;
Yandex mirror still has an order of magnitude more bandwidth.
23 lines
742 B
Bash
Executable File
23 lines
742 B
Bash
Executable File
#!/bin/sh
|
|
# enable online repos if possible, just quit if anything's wrong
|
|
|
|
repo_source='/etc/apt/sources.list.d/yandex.list'
|
|
|
|
[ -s "$repo_source" ] || exit 0
|
|
|
|
# regexps from alterator-pkg (via installer-feature-online-repo)
|
|
prefix_re="[[:space:]]*rpm[[:space:]]\+\([^[:space:]]\+[[:space:]]\+\)\?"
|
|
host_re="http:\/\/\([^[:space:]]\+\)[[:space:]]\+"
|
|
updates_re="${prefix_re}${host_re}\([^[:space:]]\+\/\)\?"
|
|
|
|
# architectures
|
|
host_arch="$(rpm --eval '%_arch')"
|
|
[ "$host_arch" = "x86_64" ] && compat="x86_64-i586" || compat=
|
|
[ "$host_arch" = 'armh' ] && noarch= || noarch='noarch'
|
|
|
|
# turn on unconditionally
|
|
for arch in "$host_arch" "$noarch" "$compat"; do
|
|
[ -n "$arch" ] || continue
|
|
sed -i "s/^#\($updates_re$arch\)/\1/" "$repo_source"
|
|
done
|