3
add_option "mirror" "`eval_gettext "Set the mirror location"`" "regular" "true"
3
add_option "mirror" "`eval_gettext "set the mirror location"`" "regular" "true"
4
4
add_option "early-mirror" "`eval_gettext "add a mirror, which takes priority over the default mirror"`" "advanced" "true"
5
5
add_option "extra-mirror" "`eval_gettext "add a mirror, with lower priority than the default mirror"`" "advanced" "true"
6
add_option "security-mirror" "`eval_gettext "add a security mirror"`" "advanced" "true"
9
8
if [ -n "$option_mirror_value" ]; then
15
14
if [ -n "$option_extra_mirror_value" ]; then
16
15
EXTRA_MIRROR="$option_extra_mirror_value"
18
if [ -n "$option_security_mirror_value" ]; then
19
SECURITY_MIRROR="$option_security_mirror_value"
24
# add a mirror to the chroot's sources.list
27
if [ -n "$mirror" ]; then
28
if [ -z "$(echo $mirror | awk '{print $2}')" ]; then
29
if [ "$type" = "security" ]; then
30
mirror="$mirror $DIST/updates $COMPONENTS"
32
mirror="$mirror $DIST $COMPONENTS"
35
echo "deb $mirror" >> $ROOT/etc/apt/sources.list
37
file:///*) dir="$(echo $mirror | awk '{print $1}' | sed -e 's,^file://,,g')"
39
chroot_mount $dir $dir --bind
45
add_multiple_mirrors() {
46
# feed a list of comma-separated mirrors, add them to sources.list
48
if [ -z "$(echo $mirror_list | grep ,)" ] ; then
49
# only one mirror specified
50
add_mirror "$mirror_list"
54
for mirror in $mirror_list; do
55
if [ -n "$mirror" ]; then
60
if [ -n "$OIFS" ]; then
66
19
sources_list="$ROOT/etc/apt/sources.list"
67
20
if [ -f "$sources_list" ]; then
68
21
debug " - moving aside sources.list"
69
22
mv -vf "$sources_list" "$sources_list".old
71
add_multiple_mirrors "$EARLY_MIRROR"
73
add_multiple_mirrors "$EXTRA_MIRROR"
74
add_mirror "$SECURITY_MIRROR" security
24
add_mirrors "$EARLY_MIRROR"
26
add_mirrors "$EXTRA_MIRROR"