summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorDieter Plaetinck <dieter@plaetinck.be>2009-02-14 18:43:11 +0100
committerDieter Plaetinck <dieter@plaetinck.be>2009-02-14 18:43:11 +0100
commitccc552ef115d3d7fcd5f92121ba9838e9b199361 (patch)
tree4c19a593970c17766518a263e67d6f5e48e9f2b7 /src/core
parent9e895707d72b600ab722337c7b26ce226675c11c (diff)
port of FS#12944 - Pacman mirrorlist installer edits
Diffstat (limited to 'src/core')
-rw-r--r--src/core/libs/lib-pacman.sh2
-rw-r--r--src/core/libs/lib-ui-interactive.sh9
-rw-r--r--src/core/procedures/base4
3 files changed, 7 insertions, 8 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
}
diff --git a/src/core/procedures/base b/src/core/procedures/base
index 6aa7767..c22a01c 100644
--- a/src/core/procedures/base
+++ b/src/core/procedures/base
@@ -8,7 +8,7 @@ var_RUNTIME_PACKAGES=
var_PKG_FILE=$RUNTIME_DIR/package-list # not used by default in base/interactive. can be used by custom procedures or profiles for the automatic procedure
var_MIRRORLIST="/etc/pacman.d/mirrorlist"
var_UI_TYPE="cli" # set to cli or dia for dialog
-var_ARCH=`uname -m` #i686 or x86_64
+var_ARCH=`uname -m` #i686 or x86_64. NOTE: this assumes you want to install the same arch as the installation environment you're using. maybe we could decouple those someday..
[ -z "$var_ARCH" ] && die_error "Could not determine your architecture"
###### Phases ( can be overridden by more specific procedures) ######
@@ -67,7 +67,7 @@ worker_select_source ()
{
var_PKG_SOURCE_TYPE='cd'
var_FILE_URL="file:///src/core/pkg"
- var_SYNC_URL=
+ var_SYNC_URL= # optional, points to a repository string something like ftp://ftp.belnet.be/mirror/archlinux.org/$repo/os/i686 (eg the same format as what you find in /etc/pacman.conf)
# if you override to use ftp (or ask user and he chooses ftp) don't forget to configure the network and to select_mirrors
}