From 7788bc30136665065cc35ed0d0e1406d3ef0f1e9 Mon Sep 17 00:00:00 2001 From: Marek Marczykowski Date: Sun, 25 Sep 2011 22:41:27 +0200 Subject: [PATCH] Exit with retcode!=0 on failure --- fedorize_image | 8 ++++++-- qubeize_image | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/fedorize_image b/fedorize_image index 96ba58e..35c82c3 100755 --- a/fedorize_image +++ b/fedorize_image @@ -3,6 +3,8 @@ IMG=$1 PKGLISTFILE=$2 +RETCODE=0 + : ${DIST=fc14} if ! [ $# -eq 2 ]; then @@ -38,7 +40,7 @@ else rpm --import --root=$INSTALLDIR keys/* echo "-> Installing core RPM packages..." - rpm -i --root=$INSTALLDIR base_rpms/*.rpm + rpm -i --root=$INSTALLDIR base_rpms/*.rpm || exit 1 cp clean_images/network $INSTALLDIR/etc/sysconfig cp clean_images/resolv.conf $INSTALLDIR/etc @@ -48,6 +50,8 @@ fi mount -t proc proc mnt/proc PKGGROUPS=$(cat $PKGLISTFILE) echo "-> Installing package groups..." -yum install -y --installroot=$INSTALLDIR $PKGGROUPS +yum install -y --installroot=$INSTALLDIR $PKGGROUPS || RETCODE=1 umount mnt/proc mnt + +exit $RETCODE diff --git a/qubeize_image b/qubeize_image index 2e68f61..41a1c49 100755 --- a/qubeize_image +++ b/qubeize_image @@ -3,6 +3,8 @@ CLEANIMG=$1 NAME=$2 +set -e + if [ $# -eq 0 ]; then echo "usage $0 " exit