BUILDSTATUS=`dd if="$VM_SWAP" bs=12 count=1 2>/dev/null`
case $BUILDSTATUS in
BUILDSTATUS0)
+ # usual successfull build
mkdir -p $BUILD_ROOT/.build.packages
cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
echo "build: extracting built packages..."
dd if=$VM_SWAP bs=512 skip=1 | cpio --extract --no-absolute-filenames -v
cleanup_and_exit 0
;;
- BUILDSTATUS[1-9])
+ BUILDSTATUS2)
+ # successful, but unchanged build, copy back result anyway
+ mkdir -p $BUILD_ROOT/.build.packages
+ cd $BUILD_ROOT/.build.packages || cleanup_and_exit 1
+ echo "build: extracting built packages..."
+ dd if=$VM_SWAP bs=512 skip=1 | cpio --extract --no-absolute-filenames -v
+ cleanup_and_exit 2
+ ;;
+ *)
cleanup_and_exit ${BUILDSTATUS#BUILDSTATUS}
;;
esac