mirror of
git://projects.qi-hardware.com/ben-wpan.git
synced 2024-11-29 11:47:11 +02:00
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
This commit is contained in:
parent
43d512c30a
commit
a241265aaf
@ -40,6 +40,8 @@ usage()
|
||||
cat <<EOF 1>&2
|
||||
usage: $0 [options] top-dir top-schem [commit] outdir
|
||||
|
||||
-c use cached Postscript files (from previous run, with -k)
|
||||
-k keep checked-out tree (for immediate reuse with -c)
|
||||
-r XxY image resolution (default: $RES)
|
||||
-w points Postscript line width (default: $LINEWIDTH)
|
||||
EOF
|
||||
@ -47,16 +49,20 @@ EOF
|
||||
}
|
||||
|
||||
|
||||
cache=false
|
||||
keep=false
|
||||
while true; do
|
||||
case "$1" in
|
||||
-c) cache=true
|
||||
shift;;
|
||||
-k) keep=true
|
||||
shift;;
|
||||
-r) [ -z "$2" ] && usage
|
||||
RES="$2"
|
||||
shift 2
|
||||
break;;
|
||||
shift 2;;
|
||||
-w) [ -z "$2" ] && usage
|
||||
LINEWIDTH="$2"
|
||||
shift 2
|
||||
break;;
|
||||
shift 2;;
|
||||
-*)
|
||||
usage;;
|
||||
*)
|
||||
@ -84,25 +90,27 @@ fi
|
||||
tmp="$dir/../_gitsch2ppm"
|
||||
sch="$tmp/$sdir"
|
||||
|
||||
rm -rf "$tmp"
|
||||
if ! $cache; then
|
||||
rm -rf "$tmp"
|
||||
rm -rf "$outdir"
|
||||
|
||||
git clone -s -n "$dir/.git" "$tmp" || exit
|
||||
( cd "$tmp" && git checkout -q "$commit"; ) || exit
|
||||
git clone -s -n "$dir/.git" "$tmp" || exit
|
||||
( cd "$tmp" && git checkout -q "$commit"; ) || exit
|
||||
|
||||
if [ ! -f "$tmp/$schem" ]; then
|
||||
echo "$schem not found (checked out into $tmp)" 1>&2
|
||||
exit 1
|
||||
if [ ! -f "$tmp/$schem" ]; then
|
||||
echo "$schem not found (checked out into $tmp)" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
( cd "$sch" && rm -f *.ps *.ppm && eeschema --plot "$tmp/$schem"; ) || exit
|
||||
fi
|
||||
|
||||
( cd "$sch" && rm -f *.ps *.ppm && eeschema --plot "$tmp/$schem"; ) || exit
|
||||
|
||||
for n in "$sch"/*.ps; do
|
||||
ps2ppm "$n"
|
||||
done
|
||||
|
||||
rm -rf "$outdir"
|
||||
mkdir -p "$outdir"
|
||||
|
||||
mv "$sch"/*.ppm "$outdir"
|
||||
|
||||
rm -rf "$tmp"
|
||||
$keep || rm -rf "$tmp"
|
||||
|
@ -136,8 +136,8 @@ for n in $first `git rev-list --reverse $first..HEAD`; do
|
||||
if [ ! -d "$cache/ppm_$n" ]; then
|
||||
rm -rf "$cache/ppm_$n"
|
||||
mkdir "$cache/ppm_$n"
|
||||
gitsch2ppm "$dir" "$schname" $n "$cache/ppm_$n" || exit
|
||||
gitsch2ppm -w 500 "$dir" "$schname" $n "$cache/fat_$n" || exit
|
||||
gitsch2ppm -k "$dir" "$schname" $n "$cache/ppm_$n" || exit
|
||||
gitsch2ppm -c -w 500 "$dir" "$schname" $n "$cache/fat_$n" || exit
|
||||
fi
|
||||
for m in "$cache/ppm_$n/"*; do
|
||||
[ "$m" = "$cache/ppm_$n/*" ] && break
|
||||
|
Loading…
Reference in New Issue
Block a user