All pastes #922364 Raw Edit

Miscellany

public shellscript v1 · immutable
#922364 ·published 2008-02-28 19:24 UTC
rendered paste body
#!/bin/bashTHEMEDIR="/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" checkwpsif [ -n "$1" ]; then    THEMEDIR="$1"fiif [ ! -d "$THEMEDIR" ]; then    echo "Error: $THEMEDIR is not a directory"    exit 2fifind "$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)