summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2014-08-18 16:43:54 (EDT)
committer P. J. McDermott <pj@pehjota.net>2014-08-18 16:43:54 (EDT)
commitd5fd4c18501b79b73f7c249b4f562233a1e82440 (patch)
tree7f97f855107bfe9ecbef44a0203b4e34ee6ebac7
parent54685daf378cd4cf9f521541e218ba1ab9d66e5d (diff)
install: Error if chroot dir exists
-rw-r--r--lib/cmd/install.sh5
-rw-r--r--locale/en_US.sh2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/cmd/install.sh b/lib/cmd/install.sh
index 4197fbc..277510e 100644
--- a/lib/cmd/install.sh
+++ b/lib/cmd/install.sh
@@ -66,8 +66,11 @@ cmd_install_main()
"${arch}" "${plat}"
fi
+ if [ -d "${chroot}" ]; then
+ error 2 "$(get_msg 'cmd_install_chroot_dir_exists')" "${chroot}"
+ fi
if ! mkdir "${chroot}" || ! mkdir "${chroot}/.prokit"; then
- : Error
+ error 2 "$(get_msg 'cmd_install_mkdir_chroot_fail')" "${chroot}"
fi
cmd_install_find_pkgs "${suite}" "${arch}" "${plat}" "${chroot}"
diff --git a/locale/en_US.sh b/locale/en_US.sh
index 6bf403a..86a59fa 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -59,6 +59,8 @@ 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"'
+msg_prokit_cmd_install_chroot_dir_exists='Directory "%s" exists"'
+msg_prokit_cmd_install_mkdir_chroot_fail='Failed to create directory "%s"'
# lib/profile.sh
msg_prokit_profile_not_found='Profile "%s" not found'