1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-12-01 20:04:03 +02:00

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
This commit is contained in:
Werner Almesberger 2010-08-27 15:39:39 -03:00
parent a241265aaf
commit 627d7d790b
2 changed files with 42 additions and 9 deletions

9
scripts/Makefile Normal file
View File

@ -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

View File

@ -152,17 +152,33 @@ if [ -z "$head" ]; then
exit 1 exit 1
fi fi
ppmmake '#e0e0e0' 5 20 | pnmtopng >"$out"/unchanged.png
index="$out/index.html" index="$out/index.html"
cat <<EOF >"$index" {
cat <<EOF
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML> <HTML>
<BODY> EOF
if [ ! -z "$SCHHIST_TITLE" ]; then
echo "<TITLE>$SCHHIST_TITLE</TITLE>"
fi
echo "<BODY>"
if [ ! -z "$SCHHIST_TITLE" ]; then
echo "<H1>"
[ -z "$SCHHIST_HOME_URL" ] || echo "<A href=\"$SCHHIST_HOME_URL\">"
echo "$SCHHIST_TITLE"
[ -z "$SCHHIST_HOME_URL" ] || echo "</A>"
echo "</H1>"
fi
cat <<EOF
<TABLE bgcolor="$BG_COLOR" callpadding=1> <TABLE bgcolor="$BG_COLOR" callpadding=1>
<TR bgcolor="$FNAME_COLOR"> <TR bgcolor="$FNAME_COLOR">
EOF EOF
for m in `ls -1 "$out/names"`; do for m in `ls -1 "$out/names"`; do
echo "<TD><B>$m</B>" >>"$index" echo "<TD><B>$m</B>"
done done
} >"$index"
next="$head" next="$head"
for n in `git rev-list $first..HEAD~1` $first; do 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" thumb="$out/thumb_$next/$m.png"
if [ -f "$a" -a -f "$b" ]; then if [ -f "$a" -a -f "$b" ]; then
s="$s<TD>" s="$s<TD align=\"center\" valign=\"middle\">"
pngdiff cat "$diff" "$a" "$b" || continue if ! pngdiff cat "$diff" "$a" "$b"; then
s="$s<IMG src=\"unchanged.png\""
continue
fi
pngdiff shrink "$thumb" -f $THUMB_OPTS "$fat_a" "$fat_b" \ pngdiff shrink "$thumb" -f $THUMB_OPTS "$fat_a" "$fat_b" \
"$a" "$b" || exit "$a" "$b" || exit
elif [ -f "$a" ]; then elif [ -f "$a" ]; then
@ -211,7 +230,13 @@ EOF
mkdir -p "$out/diff_$next" "$out/thumb_$next" mkdir -p "$out/diff_$next" "$out/thumb_$next"
echo "<PRE>" echo "<PRE>"
git log --pretty=short $next~1..$next | git log --pretty=short $next~1..$next |
sed 's/&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g' if [ -z "$SCHHIST_COMMIT_TEMPLATE" ]; then
cat
else
url=`echo "$SCHHIST_COMMIT_TEMPLATE" | sed "s/{}/$next/g"`
sed "s|^commit |<A href=\"$url\">commit</a> |"
fi |
sed '/^<.*>commit</n;s/&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g'
echo "</PRE>" echo "</PRE>"
) >>"$index" ) >>"$index"
fi fi
@ -225,4 +250,3 @@ cat <<EOF >>"$index"
</BODY> </BODY>
</HTML> </HTML>
EOF EOF
exit 1