diff --git a/scripts/Makefile b/scripts/Makefile new file mode 100644 index 0000000..4c4d6a7 --- /dev/null +++ b/scripts/Makefile @@ -0,0 +1,9 @@ +.PHONY: all ben-wpan-schhist + +all: + +ben-wpan-schhist: + SCHHIST_TITLE=ben-wpan/atrf \ + SCHHIST_HOME_URL=http://projects.qi-hardware.com/index.php/p/ben-wpan/ \ + SCHHIST_COMMIT_TEMPLATE='http://projects.qi-hardware.com/index.php/p/ben-wpan/source/commit/{}/' \ + ./schhist2web atrf/wpan-atrf.sch diff --git a/scripts/schhist2web b/scripts/schhist2web index 740afe5..9fb7019 100755 --- a/scripts/schhist2web +++ b/scripts/schhist2web @@ -152,17 +152,33 @@ if [ -z "$head" ]; then exit 1 fi +ppmmake '#e0e0e0' 5 20 | pnmtopng >"$out"/unchanged.png + index="$out/index.html" -cat <"$index" +{ + cat < - +EOF + if [ ! -z "$SCHHIST_TITLE" ]; then + echo "$SCHHIST_TITLE" + fi + echo "" + if [ ! -z "$SCHHIST_TITLE" ]; then + echo "

" + [ -z "$SCHHIST_HOME_URL" ] || echo "" + echo "$SCHHIST_TITLE" + [ -z "$SCHHIST_HOME_URL" ] || echo "" + echo "

" + fi + cat < EOF -for m in `ls -1 "$out/names"`; do - echo "$m" >>"$index" -done + for m in `ls -1 "$out/names"`; do + echo "$m" + done +} >"$index" next="$head" for n in `git rev-list $first..HEAD~1` $first; do @@ -179,8 +195,11 @@ for n in `git rev-list $first..HEAD~1` $first; do thumb="$out/thumb_$next/$m.png" if [ -f "$a" -a -f "$b" ]; then - s="$s" - pngdiff cat "$diff" "$a" "$b" || continue + s="$s" + if ! pngdiff cat "$diff" "$a" "$b"; then + s="$s" git log --pretty=short $next~1..$next | - sed 's/&/&/g;s//\>/g' + if [ -z "$SCHHIST_COMMIT_TEMPLATE" ]; then + cat + else + url=`echo "$SCHHIST_COMMIT_TEMPLATE" | sed "s/{}/$next/g"` + sed "s|^commit |commit |" + fi | + sed '/^<.*>commit/\>/g' echo "" ) >>"$index" fi @@ -225,4 +250,3 @@ cat <>"$index" EOF -exit 1