summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2016-01-17 11:52:37 (EST)
committer P. J. McDermott <pj@pehjota.net>2016-01-17 11:52:37 (EST)
commit2dd731a8ff9580199746954122b143a5f4dc7361 (patch)
tree6d455153c0d1ae5351bcfacd7aec18065060e4d0
parentf8cea8a63d50c972601a43abb1d8b79cf1348271 (diff)
cmd/build: Check return value of package_init()
Also clean up on error now.
-rw-r--r--src/cmd/build.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmd/build.sh b/src/cmd/build.sh
index 5151c46..d12edfb 100644
--- a/src/cmd/build.sh
+++ b/src/cmd/build.sh
@@ -80,7 +80,10 @@ cmd_build_main()
[ "x${dev}" != 'x' ] && block_umount "${root}"
return 2
fi
- package_init "${cmd_build_pkg_dir}"
+ if ! package_init "${cmd_build_pkg_dir}"; then
+ [ "x${dev}" != 'x' ] && block_umount "${root}"
+ return 2
+ fi
package_set_substvars "${arch}" "${plat}"
session_begin "${root}" "${cmd_build_pkg_dir}" cmd_build_fini false