Commit 97f7e2f2 authored by Aaron Griffin's avatar Aaron Griffin
Browse files

Check mkarchroot's return code



We weren't doing this before, and after build steps were
being run even if the build failed or if the user cancelled
the build

Signed-off-by: default avatarAaron Griffin <aaronmgriffin@gmail.com>
parent f6f7a52f
Loading
Loading
Loading
Loading
+21 −18
Original line number Diff line number Diff line
@@ -218,8 +218,7 @@ EOF
) > "$uniondir/chrootbuild"
chmod +x "$uniondir/chrootbuild"

mkarchroot -r "/chrootbuild" "$uniondir"

if mkarchroot -r "/chrootbuild" "$uniondir"; then
    source ${WORKDIR}/PKGBUILD

    if [ -n "$add_to_db" ]; then
@@ -238,6 +237,10 @@ if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then
        echo "Moving downloaded source files to ${WORKDIR}"
        mv ${chrootdir}/union/srcdest/* ${WORKDIR}
    fi
else
    #just in case. We returned 1, make sure we fail
    touch ${chrootdir}/rw/build/BUILD_FAILED
fi

if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then
    echo "Build failed, check $chrootdir/rw/build"