From 3fca5b14bb30dca5f33108be1048acbc1c733787 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Mon, 18 Aug 2014 17:15:17 -0400 Subject: install: Add mirror selection, with an -m option --- (limited to 'lib') diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh index 277510e..08da39d 100644 --- a/lib/cmd/install.sh +++ b/lib/cmd/install.sh @@ -21,7 +21,7 @@ use getopt use feed use profile -cmd_install_optstring='a:P:' +cmd_install_optstring='a:P:m:' cmd_install_main() { @@ -30,6 +30,7 @@ cmd_install_main() local arch= local plat= local profile= + local mirror= get_options "${@}" shift $(($OPTIND - 1)) @@ -66,6 +67,13 @@ cmd_install_main() "${arch}" "${plat}" fi + if [ "x${cmd_install_opt_m+set}" = 'xset' ]; then + mirror="${cmd_install_opt_m}" + else + mirror="$(profile_select_mirror)" + fi + info "$(get_msg 'cmd_install_selected_mirror')" "${mirror}" + if [ -d "${chroot}" ]; then error 2 "$(get_msg 'cmd_install_chroot_dir_exists')" "${chroot}" fi -- cgit v0.9.1