Skip to content
Snippets Groups Projects
Commit bcc6d4c6 authored by Natanael Copa's avatar Natanael Copa
Browse files

scripts/mkimage.sh: exit early on error

parent d85035c7
No related merge requests found
...@@ -113,6 +113,7 @@ build_section() { ...@@ -113,6 +113,7 @@ build_section() {
else else
rm -rf "$DESTDIR" rm -rf "$DESTDIR"
_fail="yes" _fail="yes"
return 1
fi fi
fi fi
fi fi
...@@ -134,7 +135,7 @@ build_profile() { ...@@ -134,7 +135,7 @@ build_profile() {
# Collect list of needed sections, and make sure they are built # Collect list of needed sections, and make sure they are built
for SECTION in $all_sections; do for SECTION in $all_sections; do
section_$SECTION section_$SECTION || return 1
done done
[ "$_fail" = "no" ] || return 1 [ "$_fail" = "no" ] || return 1
...@@ -163,7 +164,7 @@ build_profile() { ...@@ -163,7 +164,7 @@ build_profile() {
if [ "$_dirty" = "yes" -o ! -e "$output_filename" ]; then if [ "$_dirty" = "yes" -o ! -e "$output_filename" ]; then
# Create image # Create image
output_format="${image_ext//[:\.]/}" output_format="${image_ext//[:\.]/}"
create_image_${output_format} || _fail="yes" create_image_${output_format} || { _fail="yes"; false; }
if [ "$_checksum" = "yes" ]; then if [ "$_checksum" = "yes" ]; then
for _c in $all_checksums; do for _c in $all_checksums; do
...@@ -221,6 +222,6 @@ for ARCH in $req_arch; do ...@@ -221,6 +222,6 @@ for ARCH in $req_arch; do
abuild-apk update --root "$APKROOT" abuild-apk update --root "$APKROOT"
for PROFILE in $req_profiles; do for PROFILE in $req_profiles; do
(build_profile) (build_profile) || exit 1
done done
done done
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment