diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2009-02-14 18:43:11 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2009-02-14 18:43:11 +0100 |
commit | ccc552ef115d3d7fcd5f92121ba9838e9b199361 (patch) | |
tree | 4c19a593970c17766518a263e67d6f5e48e9f2b7 /src/core/libs | |
parent | 9e895707d72b600ab722337c7b26ce226675c11c (diff) |
port of FS#12944 - Pacman mirrorlist installer edits
Diffstat (limited to 'src/core/libs')
-rw-r--r-- | src/core/libs/lib-pacman.sh | 2 | ||||
-rw-r--r-- | src/core/libs/lib-ui-interactive.sh | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 89c3638..4497074 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -78,7 +78,7 @@ do then add_pacman_repo target ${repo} "Include = $var_MIRRORLIST" else - add_pacman_repo target ${repo} "Server = ${serverurl}" + add_pacman_repo target ${repo} "Server = ${serverurl/\/\$repo\//\/$repo\/}" # replace literal '/$repo/' in the serverurl string by "/$repo/" where $repo is our variable. fi done # Set up the necessary directories for pacman use diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 851e990..343ecc4 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -865,13 +865,12 @@ interactive_select_mirror() { local _server=$ANSWER_OPTION if [ "${_server}" = "Custom" ]; then ask_string "Enter the full URL to core repo." "ftp://ftp.archlinux.org/core/os/$var_ARCH" || return 1 - var_SYNC_URL=$ANSWER_STRING + var_SYNC_URL=${ANSWER_STRING/\/core\///\$repo/} #replace '/core/' by '/$repo/' else # Form the full URL for our mirror by grepping for the server name in - # our mirrorlist and pulling the full URL out. Substitute 'core' in - # for the repository name, and ensure that if it was listed twice we - # only return one line for the mirror. - var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | sed 's/\$repo/core/g' | head -n1) + # our mirrorlist and pulling the full URL out. + # Ensure that if it was listed twice we only return one line for the mirror. + var_SYNC_URL=$(egrep -o "${_server}.*" "${var_MIRRORLIST}" | head -n1) fi echo "Using mirror: $var_SYNC_URL" >$LOG } |