diff options
-rwxr-xr-x | makechrootpkg | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/makechrootpkg b/makechrootpkg index 2a6e1b0..3fad3f0 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -11,6 +11,7 @@ FORCE="n" RUN="" MAKEPKG_ARGS="-Ss" +WORKDIR=$PWD chrootdir="$CHROOT_SHELL" @@ -114,12 +115,20 @@ fi #!/bin/bash export LANG=$LOCALE cd /build -sudo -u nobody makepkg $MAKEPKG_ARGS +sudo -u nobody makepkg $MAKEPKG_ARGS || touch BUILD_FAILED EOF ) > "$uniondir/chrootbuild" chmod +x "$uniondir/chrootbuild" mkarchroot -r "/chrootbuild" "$uniondir" -# TODO move relevant files here -echo "build complete... check \$CHROOT_SHELL/build for build results" +if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then + echo "Build failed, check \$CHROOT_DIR/rw/build" + rm ${chrootdir}/rw/build/BUILD_FAILED + exit 1 +else + source ${WORKDIR}/PKGBUILD + mv ${chrootdir}/rw/build/${pkgname}-${pkgver}-*.pkg.tar.gz ${WORKDIR} + rm -rf ${chrootdir}/rw/build/* + echo "Build complete" +fi |