1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-23 13:19:41 +02:00

sch2fig/sch2pdf: use correct output file name; pass on -t template.fig

This commit is contained in:
Werner Almesberger 2016-07-26 02:32:53 -03:00
parent 09d436175a
commit 83be43d222

View File

@ -2,19 +2,24 @@
usage() usage()
{ {
echo "usage: $0 [-o output.pdf] [-q] file.lib ... file.sch" 1>&2 cat <<EOF 1>&2
usage: $0 [-o output.pdf] [-q] [-t template.fig ] file.lib ... file.sch
EOF
exit 1 exit 1
} }
out=out.pdf out=out.pdf
quiet=false quiet=false
template=
while [ "$1" ]; do while [ "$1" ]; do
case "$1" in case "$1" in
-o) out=$2 -o) out=$2
shift 2;; shift 2;;
-q) quiet=true -q) quiet=true
shift;; shift;;
-t) template="-t $2"
shift 2;;
-*) usage;; -*) usage;;
*) break;; *) break;;
esac esac
@ -32,12 +37,12 @@ first=true
for n in `sed '/\$Sheet/,/\$EndSheet/p;d' "$1" | for n in `sed '/\$Sheet/,/\$EndSheet/p;d' "$1" |
sed '/F1 "\([^"]*\)" .*/s//\1/p;d'`; do sed '/F1 "\([^"]*\)" .*/s//\1/p;d'`; do
$quiet || echo "$n" 1>&2 $quiet || echo "$n" 1>&2
./sch2fig $libs `dirname "$1"`/$n | fig2dev -L pdf >_tmp.pdf ./sch2fig $template $libs `dirname "$1"`/$n | fig2dev -L pdf >_tmp.pdf
if $first; then if $first; then
mv _tmp.pdf "$out" mv _tmp.pdf "$out"
first=false first=false
else else
pdfunite out.pdf _tmp.pdf _tmp2.pdf pdfunite "$out" _tmp.pdf _tmp2.pdf
mv _tmp2.pdf "$out" mv _tmp2.pdf "$out"
fi fi
done done