summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-18 17:15:17 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-18 17:15:17 (EDT)
commit3fca5b14bb30dca5f33108be1048acbc1c733787 (patch)
treedb41470470cc05f9d10bc29a9a4b24412b2d6ba2
parentb60f2eac850d71e600ae149515fd94f554e267ee (diff)
install: Add mirror selection, with an -m option
-rw-r--r--lib/cmd/install.sh10
-rw-r--r--locale/en_US.sh4
2 files changed, 12 insertions, 2 deletions
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 <arch>] [-P <plat>] <suite> <chroot>'
+msg_prokit_cmd_install_usage='[-a <arch>] [-P <plat>] [-m <mirror>] '\
+'<suite> <chroot>'
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'