1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-29 15:39:21 +02:00

schhist2web: users can now specify how names are ordered.

- schhist/schhist2web: sort names in the order specified by the environment
  variable SCHHIST_ORDER (colon-separated list of names)
- schhist/Makefile (atusb-schhist): order sheets
This commit is contained in:
Werner Almesberger 2010-09-22 10:14:38 -03:00
parent 16001d32a7
commit 4780b8b33b
2 changed files with 16 additions and 3 deletions

View File

@ -23,6 +23,7 @@ atusb-schhist:
SCHHIST_TITLE=ben-wpan/atrf \ SCHHIST_TITLE=ben-wpan/atrf \
SCHHIST_HOME_URL=http://projects.qi-hardware.com/index.php/p/ben-wpan/ \ 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/{}/' \ SCHHIST_COMMIT_TEMPLATE='http://projects.qi-hardware.com/index.php/p/ben-wpan/source/commit/{}/' \
SCHHIST_ORDER=wpan-atrf:USB:RF \
./schhist2web ../../ben-wpan atrf/wpan-atrf.sch _atusb ./schhist2web ../../ben-wpan atrf/wpan-atrf.sch _atusb
atusb-schhist-upload: atusb-schhist-upload:

View File

@ -95,6 +95,18 @@ EOF
} }
ordered_names()
{
ls -1 "$out/names" | (
order=:$SCHHIST_ORDER:
while read n; do
echo "${order%%:$n:*}" | tr -cd : | wc -c | tr '\n' ' '
echo "$n"
done; ) |
sort -n -s | sed 's/^[^ ]* //'
}
usage() usage()
{ {
cat <<EOF 2>&1 cat <<EOF 2>&1
@ -334,7 +346,7 @@ EOF
else else
echo "<TD><B>$m</B>" echo "<TD><B>$m</B>"
fi fi
done < <(ls -1 "$out/names") done < <(ordered_names)
proj=`basename "$sch" .sch` proj=`basename "$sch" .sch`
eval schps2pdf -t \""$proj-"\" -o \""$out/pdf_$proj.pdf"\" $all eval schps2pdf -t \""$proj-"\" -o \""$out/pdf_$proj.pdf"\" $all
echo "<TD><A href=\"pdf_$proj.pdf\">All sheets</A>" echo "<TD><A href=\"pdf_$proj.pdf\">All sheets</A>"
@ -394,7 +406,7 @@ for n in `cd "$dir" && git rev-list $first..HEAD~1` $first; do
s= s=
wrapped_png "$out" "$next" "$m" wrapped_png "$out" "$next" "$m"
empty=false empty=false
done < <(ls -1 "$out/names") done < <(ordered_names)
if ! $empty; then if ! $empty; then
echo "$s<TD valign=\"middle\">" echo "$s<TD valign=\"middle\">"
commit_entry "$dir" $next commit_entry "$dir" $next
@ -426,7 +438,7 @@ if [ -d "$cache/$next/ppm0" ]; then # could this ever be false ?
schps2pdf -T NEW -o "$pdf" "$ps" || exit schps2pdf -T NEW -o "$pdf" "$ps" || exit
wrapped_png "$out" "$next" "$m" wrapped_png "$out" "$next" "$m"
empty=false empty=false
done < <(ls -1 "$out/names") done < <(ordered_names)
if ! $empty; then if ! $empty; then
echo "<TD valign=\"middle\">" echo "<TD valign=\"middle\">"
commit_entry "$dir" $next commit_entry "$dir" $next