LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File pre_checkin.sh of Package JeOS (Project openSUSE:12.2:ARM)

#!/bin/bash
set -e

CPP=cpp
if [ -e /usr/bin/cpp-4.6 ]; then
    # SLES11 has cpp4.3 as default which generates spurious blank lines
    CPP=cpp-4.6
fi


# Define an enum type to know what kind of image we are building
ROOTFS=0
JEOS=1
XFCE=2

for i in JeOS JeOS-beagle JeOS-imx51 JeOS-panda JeOS-vexpress \
	 XFCE-panda XFCE-beagle; do

    if [[ $i == XFCE-* ]]; then
        image_type=$XFCE
	image_type_string="XFCE"
	flavor="${i/XFCE-/}"
    elif [[ $i == JeOS-* ]]; then
        image_type=$JEOS
	image_type_string="JeOS"
	flavor="${i/JeOS-/}"
    else
	image_type=$ROOTFS
	image_type_string="rootfs"
	flavor="${i/JeOS-/}"
    fi;
    image_type_info="-DROOTFS=$ROOTFS -DJEOS=$JEOS -DXFCE=$XFCE -DIMAGE_TYPE=$image_type -DIMAGE_TYPE_STRING=$image_type_string"
    t=$(mktemp)
    echo "Formatting $i"
    $CPP $image_type_info -DIS_FLAVOR_$flavor=1 -DFLAVOR_TYPE=$flavor -P Images.kiwi.in -o $t
    # this will abort if there's an error (see set -e)
    xmllint --format $t --output $i.kiwi || break
    rm -f $t
done