Date:2010-08-27 20:39:39 (10 years 2 months ago)
Author:Werner Almesberger
Commit:627d7d790beaea78daccda52d57ffcd08b482bf5
Message:Add links to project page and commit. Put placeholder if sheet doesn't change.

- scripts/schhist2web: show a vertial dash in places where a sheet didn't
change
- scripts/schhist2web: new environment variable SCHHIST_TITLE to set the
title
- scripts/schhist2web: new environment variable SCHHIST_HOME_URL for the
URL the title links to
- scripts/schhist2web: new environment variable SCHHIST_COMMIT_TEMPLATE
for a template to link to the commit ({} gets replaced with the hash)
- scripts/Makefile: schematics history build example for ben-wpan/atrf
- scripts/schhist2web: at the very end, don't exit 1 on success
Files: scripts/Makefile (1 diff)
scripts/schhist2web (4 diffs)

Change Details

scripts/Makefile
1.PHONY: all ben-wpan-schhist
2
3all:
4
5ben-wpan-schhist:
6    SCHHIST_TITLE=ben-wpan/atrf \
7      SCHHIST_HOME_URL=http://projects.qi-hardware.com/index.php/p/ben-wpan/ \
8      SCHHIST_COMMIT_TEMPLATE='http://projects.qi-hardware.com/index.php/p/ben-wpan/source/commit/{}/' \
9      ./schhist2web atrf/wpan-atrf.sch
scripts/schhist2web
152152    exit 1
153153fi
154154
155ppmmake '#e0e0e0' 5 20 | pnmtopng >"$out"/unchanged.png
156
155157index="$out/index.html"
156cat <<EOF >"$index"
158{
159    cat <<EOF
157160<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
158161<HTML>
159<BODY>
162EOF
163    if [ ! -z "$SCHHIST_TITLE" ]; then
164    echo "<TITLE>$SCHHIST_TITLE</TITLE>"
165    fi
166    echo "<BODY>"
167    if [ ! -z "$SCHHIST_TITLE" ]; then
168    echo "<H1>"
169    [ -z "$SCHHIST_HOME_URL" ] || echo "<A href=\"$SCHHIST_HOME_URL\">"
170    echo "$SCHHIST_TITLE"
171    [ -z "$SCHHIST_HOME_URL" ] || echo "</A>"
172    echo "</H1>"
173    fi
174    cat <<EOF
160175<TABLE bgcolor="$BG_COLOR" callpadding=1>
161176<TR bgcolor="$FNAME_COLOR">
162177EOF
163for m in `ls -1 "$out/names"`; do
164    echo "<TD><B>$m</B>" >>"$index"
165done
178    for m in `ls -1 "$out/names"`; do
179    echo "<TD><B>$m</B>"
180    done
181} >"$index"
166182
167183next="$head"
168184for n in `git rev-list $first..HEAD~1` $first; do
...... 
179195    thumb="$out/thumb_$next/$m.png"
180196
181197    if [ -f "$a" -a -f "$b" ]; then
182        s="$s<TD>"
183        pngdiff cat "$diff" "$a" "$b" || continue
198        s="$s<TD align=\"center\" valign=\"middle\">"
199        if ! pngdiff cat "$diff" "$a" "$b"; then
200        s="$s<IMG src=\"unchanged.png\""
201        continue
202        fi
184203        pngdiff shrink "$thumb" -f $THUMB_OPTS "$fat_a" "$fat_b" \
185204          "$a" "$b" || exit
186205    elif [ -f "$a" ]; then
...... 
211230    mkdir -p "$out/diff_$next" "$out/thumb_$next"
212231        echo "<PRE>"
213232        git log --pretty=short $next~1..$next |
214          sed 's/&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
233          if [ -z "$SCHHIST_COMMIT_TEMPLATE" ]; then
234        cat
235          else
236        url=`echo "$SCHHIST_COMMIT_TEMPLATE" | sed "s/{}/$next/g"`
237        sed "s|^commit |<A href=\"$url\">commit</a> |"
238          fi |
239          sed '/^<.*>commit</n;s/&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
215240        echo "</PRE>"
216241    ) >>"$index"
217242    fi
...... 
225250</BODY>
226251</HTML>
227252EOF
228exit 1

Archive Download the corresponding diff file



interactive