mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-29 12:32:28 +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:
parent
a241265aaf
commit
627d7d790b
9
scripts/Makefile
Normal file
9
scripts/Makefile
Normal 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
|
@ -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/&/&/g;s/</\</g;s/>/\>/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/&/&/g;s/</\</g;s/>/\>/g'
|
||||||
echo "</PRE>"
|
echo "</PRE>"
|
||||||
) >>"$index"
|
) >>"$index"
|
||||||
fi
|
fi
|
||||||
@ -225,4 +250,3 @@ cat <<EOF >>"$index"
|
|||||||
</BODY>
|
</BODY>
|
||||||
</HTML>
|
</HTML>
|
||||||
EOF
|
EOF
|
||||||
exit 1
|
|
||||||
|
Loading…
Reference in New Issue
Block a user