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 --- 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 diff --git a/locale/en_US.sh b/locale/en_US.sh index 86a59fa..3e07a90 100644 --- a/locale/en_US.sh +++ b/locale/en_US.sh @@ -56,11 +56,13 @@ There is NO WARRANTY, to the extent permitted by law.' # lib/cmd/install.sh msg_prokit_cmd_install_summary='install a ProteanOS system into a directory' -msg_prokit_cmd_install_usage='[-a ] [-P ] ' +msg_prokit_cmd_install_usage='[-a ] [-P ] [-m ] '\ +' ' msg_prokit_cmd_install_bad_archplat='Invalid combination of architecture "%s" '\ 'and platform "%s"' msg_prokit_cmd_install_chroot_dir_exists='Directory "%s" exists"' msg_prokit_cmd_install_mkdir_chroot_fail='Failed to create directory "%s"' +msg_prokit_cmd_install_selected_mirror='Using mirror %s' # lib/profile.sh msg_prokit_profile_not_found='Profile "%s" not found' -- cgit v0.9.1