tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum-raw.tar.bz2 \
--exclude=$imagename.$imagearch-$imageversion.iso \
--exclude=$imagename.$imagearch-$imageversion.raw \
- *
+ * || cleanup_and_exit 1
if [ -e $imagename.$imagearch-$imageversion.iso ]; then
echo "Copy iso file and create md5..."
mv $imagename.$imagearch-$imageversion.iso \
- $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum.iso
+ $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum.iso || cleanup_and_exit 1
pushd $BUILD_ROOT/$TOPDIR/KIWI > /dev/null
md5sum $imagename.$imagearch-$imageversion$buildnum.iso \
- > "$imagename.$imagearch-$imageversion$buildnum.iso.md5"
+ > "$imagename.$imagearch-$imageversion$buildnum.iso.md5" || cleanup_and_exit 1
popd > /dev/null
fi
if [ -e $imagename.$imagearch-$imageversion.raw ]; then
echo "Copy raw file and create md5..."
mv $imagename.$imagearch-$imageversion.raw \
- $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum.raw
+ $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum.raw || cleanup_and_exit 1
pushd $BUILD_ROOT/$TOPDIR/KIWI > /dev/null
bzip2 $imagename.$imagearch-$imageversion$buildnum.raw && \
md5sum $imagename.$imagearch-$imageversion$buildnum.raw.bz2 \
- > "$imagename.$imagearch-$imageversion$buildnum.raw.bz2.md5"
+ > "$imagename.$imagearch-$imageversion$buildnum.raw.bz2.md5" || cleanup_and_exit 1
popd > /dev/null
fi
popd > /dev/null
if [ -e $imagename.$imagearch-$imageversion.xenconfig ] ; then
tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum-xenvmx.tar.bz2 \
$imagename.$imagearch-$imageversion.raw \
- $imagename.$imagearch-$imageversion.xenconfig
+ $imagename.$imagearch-$imageversion.xenconfig || cleanup_and_exit 1
else
tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum-vmx.tar.bz2 \
$imagename.$imagearch-$imageversion.vmx \
- $imagename.$imagearch-$imageversion.vmdk
+ $imagename.$imagearch-$imageversion.vmdk || cleanup_and_exit 1
if [ -e $imagename.$imagearch-$imageversion.ovf ] ; then
tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum-ovf.tar.bz2 \
$imagename.$imagearch-$imageversion.ovf \
- $imagename.$imagearch-$imageversion-disk*.vmdk
+ $imagename.$imagearch-$imageversion-disk*.vmdk || cleanup_and_exit 1
fi
fi
popd > /dev/null
`grep ^kernel $imagename.$imagearch-$imageversion.xenconfig | cut -d'"' -f2` \
`grep ^ramdisk $imagename.$imagearch-$imageversion.xenconfig | cut -d'"' -f2` \
$imagename.$imagearch-$imageversion.xenconfig \
- $imagename.$imagearch-$imageversion
+ $imagename.$imagearch-$imageversion || cleanup_and_exit 1
popd > /dev/null
;;
pxe)
$imagename.$imagearch-$imageversion.config \
$imagename.$imagearch-$imageversion.md5 \
$imagename.$imagearch-$imageversion.gz \
- initrd-*
+ initrd-* || cleanup_and_exit 1
popd > /dev/null
;;
iso)
echo "creating md5 sum for iso images... "
for i in *.iso; do
pushd $BUILD_ROOT/$TOPDIR/KIWI/ > /dev/null
- mv $BUILD_ROOT/$TOPDIR/KIWI-iso/$i ${i%.iso}$buildnum.iso
- md5sum ${i%.iso}$buildnum.iso > ${i%.iso}$buildnum.iso.md5
+ mv $BUILD_ROOT/$TOPDIR/KIWI-iso/$i ${i%.iso}$buildnum.iso || cleanup_and_exit 1
+ md5sum ${i%.iso}$buildnum.iso > ${i%.iso}$buildnum.iso.md5 || cleanup_and_exit 1
popd > /dev/null
done
popd > /dev/null
pushd $BUILD_ROOT/$TOPDIR/KIWI-$imgtype > /dev/null
echo "compressing unkown images... "
tar cvjfS $BUILD_ROOT/$TOPDIR/KIWI/$imagename.$imagearch-$imageversion$buildnum-$imgtype.tar.bz2 \
- *
+ * || cleanup_and_exit 1
popd > /dev/null
;;
esac