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


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

    if [[ $i == XFCE-* ]]; then
        image_type=TYPE_XFCE
	image_type_string="XFCE"
	flavor="${i/XFCE-/}"
    elif [[ $i == JeOS-* ]]; then
        image_type=TYPE_JEOS
	image_type_string="JeOS"
	flavor="${i/JeOS-/}"
    else
	echo "Unknown image type: $i"
	exit 1
    fi;

    # special case JeOS-rootfs, it's called "JeOS" as package
    if [ "$i" = "JeOS-rootfs" ]; then
        i="JeOS"
    fi
    image_type_info="-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