From ceb84394f9927d04543815b03d3b6c31f478669d Mon Sep 17 00:00:00 2001 From: Armin Luntzer Date: Thu, 22 Nov 2007 19:56:44 +0100 Subject: makechrootpkg: Check if build was successful. Copy package to cwd and cleanup $chrootdir/rw/build on success, keep directory contents on failure. Signed-off-by: Jason Chu --- makechrootpkg | 15 ++++++++++++--- 1 file 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 -- cgit v1.2.3-70-g09d2