#!/bin/bash THEMEDIR="/path/to/themes" TEMPDIR="/tmp/`basename $0`" TOOLSDIR="/path/to/rockbox/tools/" svn update "$TOOLSDIR" REV=`$TOOLSDIR/svnversion.sh "$TOOLSDIR"` CHECKWPS="${TOOLSDIR}/checkwps" make -C "$TOOLSDIR" checkwps if [ -n "$1" ]; then THEMEDIR="$1" fi if [ ! -d "$THEMEDIR" ]; then echo "Error: $THEMEDIR is not a directory" exit 2 fi find "$THEMEDIR" -name "*zip" |(while read zipfile; do mkdir -p "$TEMPDIR"; if [ ! -d "$TEMPDIR" ]; then echo "Error: $TEMPDIR doesn't exist and couldn't be created" exit 1 fi echo $zipfile unzip -d "$TEMPDIR" "$zipfile" "*.wps" >/dev/null find "$TEMPDIR" -name "*.wps" |(PASS="false"; while read wps; do result=`${CHECKWPS} "$wps"` if [ "$result" = "WPS parsed OK" ]; then # WPS is valid echo " PASS: $wps" PASS="true" else # WPS is invalid echo " FAIL: $wps" fi done; echo " Theme pass: $PASS (${REV})" ) rm -rf "$TEMPDIR" done)