From 3ab327e901495d4781860da9ca5b17989904a4ba Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Jan 2016 14:12:26 -0500 Subject: cmd/install*: Check return value of install_system() Also clean up on error. --- (limited to 'src/cmd') diff --git a/src/cmd/install.sh b/src/cmd/install.sh index 8d75e2c..d32f488 100644 --- a/src/cmd/install.sh +++ b/src/cmd/install.sh @@ -69,9 +69,12 @@ cmd_install_main() fi fi - install_system "${cmd_install_opt_m-}" "${suite}" \ - "${cmd_install_opt_a-}" "${cmd_install_opt_p-}" \ - "${root}" "${foreign}" + if ! install_system "${cmd_install_opt_m-}" "${suite}" \ + "${cmd_install_opt_a-}" "${cmd_install_opt_p-}" \ + "${root}" "${foreign}"; then + [ "x${dev}" != 'x' ] && block_umount "${root}" + return 1 + fi [ "x${dev}" != 'x' ] && block_umount "${root}" diff --git a/src/cmd/installer-pc.sh b/src/cmd/installer-pc.sh index f118eae..a96a7cf 100644 --- a/src/cmd/installer-pc.sh +++ b/src/cmd/installer-pc.sh @@ -72,9 +72,13 @@ cmd_installer_pc_main() return 2 fi - install_system "${cmd_installer_pc_opt_m-}" "${suite}" \ - "${cmd_installer_pc_opt_a-}" "${cmd_installer_pc_opt_p-}" \ - "${root}" false + if ! install_system "${cmd_installer_pc_opt_m-}" "${suite}" \ + "${cmd_installer_pc_opt_a-}" \ + "${cmd_installer_pc_opt_p-}" \ + "${root}" false; then + block_umount "${root}" + return 1 + fi if [ -f "${root}/sbin/lilo" ]; then read b4 b3 b2 b1 <<-EOF -- cgit v0.9.1