summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-17 20:49:50 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-17 20:49:50 (EDT)
commit9c719846187e702fba022d602b5fe9a88ae5809a (patch)
tree67f40bb9c2f0bce2cfb00b66f35fa4982e24ed6f
parent3306d90f7944c347ef6dd6aed6bfb55f0a68b9c2 (diff)
install: Validate architecture and platform
-rw-r--r--lib/cmd/install.sh4
-rw-r--r--locale/en_US.sh2
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index 1322209..a296891 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -59,6 +59,10 @@ cmd_install_main()
if [ "x${cmd_install_opt_P+set}" = 'xset' ]; then
plat="${cmd_install_opt_P}"
fi
+ if ! profile_validate_archplat "${arch}" "${plat}"; then
+ error 2 "$(get_msg 'cmd_install_bad_archplat')" \
+ "${arch}" "${plat}"
+ fi
if ! mkdir "${chroot}" || ! mkdir "${chroot}/.prokit"; then
: Error
diff --git a/locale/en_US.sh b/locale/en_US.sh
index 4e22ef3..6bf403a 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -57,6 +57,8 @@ 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_bad_archplat='Invalid combination of architecture "%s" '\
+'and platform "%s"'
# lib/profile.sh
msg_prokit_profile_not_found='Profile "%s" not found'