Advertising
- wpschecker
- Monday, March 3rd, 2008 at 4:43:38pm MST
- #!/bin/bash
- THEMEDIR="."
- TEMPDIR="/tmp/`basename $0`"
- TOOLSDIR="/home/rasher/apps/rockbox/build-env/src/rockbox/clean/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;
- if [ "$PASS" = "true" ]; then
- # Whole theme (at least one WPS) is valid
- echo " Theme pass"
- # Delete .fail file if one exists
- rm -f "$zipfile.fail"
- # Always keep the latest passing REV
- echo $REV > "$zipfile.pass"
- else
- # Whole theme (all WPS) is invalid
- # Keep a .fail file with the first REV which failed
- if [ ! -f "$zipfile.fail" ]; then
- echo $REV > "$zipfile.fail"
- fi
- echo " Theme fail"
- fi
- )
- rm -rf "$TEMPDIR"
- done)
advertising
Update the Post
Either update this post and resubmit it with changes, or make a new post.
You may also comment on this post.
Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.