Date:2010-08-27 19:31:05 (9 years 2 months ago)
Author:Werner Almesberger
Commit:a241265aaf21f6e1989618272105c2b7c9321ce7
Message:Run eeschema only once (not twice) per commit. 20% speed improvement.

- scripts/gitsch2ppm: new option -k to keep checked-out tree
- scripts/gitsch2ppm: new option -c to reuse Postscript files from -k run
- scripts/gitsch2ppm: removed C-style use of "break" from "case"
- scripts/schhist2web: use gitsch2ppm -k and -c to half number of
eeschema runs
Files: scripts/gitsch2ppm (3 diffs)
scripts/schhist2web (1 diff)

Change Details

scripts/gitsch2ppm
4040    cat <<EOF 1>&2
4141usage: $0 [options] top-dir top-schem [commit] outdir
4242
43  -c use cached Postscript files (from previous run, with -k)
44  -k keep checked-out tree (for immediate reuse with -c)
4345  -r XxY image resolution (default: $RES)
4446  -w points Postscript line width (default: $LINEWIDTH)
4547EOF
...... 
4749}
4850
4951
52cache=false
53keep=false
5054while true; do
5155    case "$1" in
56    -c) cache=true
57    shift;;
58    -k) keep=true
59    shift;;
5260    -r) [ -z "$2" ] && usage
5361    RES="$2"
54    shift 2
55    break;;
62    shift 2;;
5663    -w) [ -z "$2" ] && usage
5764    LINEWIDTH="$2"
58    shift 2
59    break;;
65    shift 2;;
6066    -*)
6167    usage;;
6268    *)
...... 
8490tmp="$dir/../_gitsch2ppm"
8591sch="$tmp/$sdir"
8692
87rm -rf "$tmp"
93if ! $cache; then
94    rm -rf "$tmp"
95    rm -rf "$outdir"
8896
89git clone -s -n "$dir/.git" "$tmp" || exit
90( cd "$tmp" && git checkout -q "$commit"; ) || exit
97    git clone -s -n "$dir/.git" "$tmp" || exit
98    ( cd "$tmp" && git checkout -q "$commit"; ) || exit
9199
92if [ ! -f "$tmp/$schem" ]; then
93    echo "$schem not found (checked out into $tmp)" 1>&2
94    exit 1
95fi
100    if [ ! -f "$tmp/$schem" ]; then
101        echo "$schem not found (checked out into $tmp)" 1>&2
102        exit 1
103    fi
96104
97( cd "$sch" && rm -f *.ps *.ppm && eeschema --plot "$tmp/$schem"; ) || exit
105    ( cd "$sch" && rm -f *.ps *.ppm && eeschema --plot "$tmp/$schem"; ) || exit
106fi
98107
99108for n in "$sch"/*.ps; do
100109    ps2ppm "$n"
101110done
102111
103rm -rf "$outdir"
104112mkdir -p "$outdir"
105113
106114mv "$sch"/*.ppm "$outdir"
107115
108rm -rf "$tmp"
116$keep || rm -rf "$tmp"
scripts/schhist2web
136136    if [ ! -d "$cache/ppm_$n" ]; then
137137    rm -rf "$cache/ppm_$n"
138138    mkdir "$cache/ppm_$n"
139    gitsch2ppm "$dir" "$schname" $n "$cache/ppm_$n" || exit
140    gitsch2ppm -w 500 "$dir" "$schname" $n "$cache/fat_$n" || exit
139    gitsch2ppm -k "$dir" "$schname" $n "$cache/ppm_$n" || exit
140    gitsch2ppm -c -w 500 "$dir" "$schname" $n "$cache/fat_$n" || exit
141141    fi
142142    for m in "$cache/ppm_$n/"*; do
143143    [ "$m" = "$cache/ppm_$n/*" ] && break

Archive Download the corresponding diff file



interactive