From ab89a00f5c51602a5f2b2b7a991bcbd8b1ccea84 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 30 Aug 2010 04:13:20 -0300 Subject: [PATCH] Generate a PDF with the all the current sheets. - scripts/schhist2web: don't generate PDF for sheets that no longer exist at HEAD - scripts/schhist2web: generate a PDF containing all sheets existing at HEAD - scripts/schps2pdf: prefix was set to the wrong argument - scripts/schps2pdf: removed left-over (and functionless) cat into gs - scripts/schps2pdf: corrected quoting of the TOC entry --- scripts/schhist2web | 16 +++++++++++++--- scripts/schps2pdf | 13 ++++++------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/scripts/schhist2web b/scripts/schhist2web index c7b82fc..2ebc32c 100755 --- a/scripts/schhist2web +++ b/scripts/schhist2web @@ -238,6 +238,7 @@ fi index="$out/index.html" +all= { cat < @@ -259,10 +260,19 @@ EOF EOF while read m; do - mkdir -p "$out/pdf_$head" - schps2pdf -o "$out/pdf_$head/$m.pdf" "$cache/ps_$head/$m.ps" || exit - echo "$m" + ps="$cache/ps_$head/$m.ps" + if [ -r "$ps" ]; then + mkdir -p "$out/pdf_$head" + schps2pdf -o "$out/pdf_$head/$m.pdf" "$ps" || exit + all="$all \"$ps\"" + echo "$m" + else + echo "$m" + fi done < <(ls -1 "$out/names") + proj=`basename "$sch" .sch` + eval schps2pdf -t \""$proj-"\" -o \""$out/pdf_$proj.pdf"\" $all + echo "All sheets" } >"$index" diff --git a/scripts/schps2pdf b/scripts/schps2pdf index e727bf9..9524e05 100755 --- a/scripts/schps2pdf +++ b/scripts/schps2pdf @@ -32,7 +32,7 @@ while true; do shift 2;; -t) [ -z "$2" ] && usage toc=true - prefix="$1" + prefix="$2" shift 2;; -*) usage;; @@ -44,9 +44,8 @@ done in=${1:--} shift -cat "$in" | - eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\""$out\"" -f \ - `for n in "$in" "$@"; do \ - name=\`basename "$n" .ps\` \ - echo "<($toc && echo '[ /Title (${name#$prefix}) /OUT pdfmark'; - cat \"$n\";)"; done` +eval gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=\""$out\"" -f \ + `for n in "$in" "$@"; do \ + echo "<(sheet=\`basename \"$n\" .ps\`; + $toc && echo '[ /Title ('\"\\${sheet#$prefix}\"') /OUT pdfmark'; + cat \"$n\";)"; done`