use/repo: add support modern sources.list format

Old format:
rpm [p7] http://ftp.altlinux.org/pub/distributions/ALTLinux/p7/branch x86_64 classic
New format:
rpm [p8] http://ftp.altlinux.org/pub/distributions/ALTLinux p8/branch/x86_64 classic
This commit is contained in:
Gleb Fotengauer-Malinovskiy 2016-10-24 12:43:46 +03:00 committed by Michael Shigorin
parent 0112879c29
commit e59e1cda26

View File

@ -2,13 +2,13 @@
# enable online repos if possible, just quit if anything's wrong
repo_source='/etc/apt/sources.list.d/alt.list'
host='http://ftp.altlinux.org'
[ -s "$repo_source" ] || exit 0
# regexps from alterator-pkg (via installer-feature-online-repo)
prefix_re="[[:space:]]*rpm[[:space:]]\+\([^[:space:]]\+[[:space:]]\+\)\?"
updates_re="${prefix_re}http:\/\/\([^[:space:]]\+\)[[:space:]]*"
host_re="http:\/\/\([^[:space:]]\+\)[[:space:]]\+"
updates_re="${prefix_re}${host_re}\([^[:space:]]\+\/\)\?"
# architectures
host_arch="$(rpm --eval '%_host_cpu')"