[Swift-commit] r3356 - text/parco10submission

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Jun 15 14:36:37 CDT 2010


Author: wozniak
Date: 2010-06-15 14:36:36 -0500 (Tue, 15 Jun 2010)
New Revision: 3356

Modified:
   text/parco10submission/lx.zsh
Log:
Improvements


Modified: text/parco10submission/lx.zsh
===================================================================
--- text/parco10submission/lx.zsh	2010-06-15 15:58:16 UTC (rev 3355)
+++ text/parco10submission/lx.zsh	2010-06-15 19:36:36 UTC (rev 3356)
@@ -5,7 +5,10 @@
 # Use +p & +d to create PDF & PS files.
 # Modify DOC to change the relevant tex file.
 # Modify TMP & BIB to use different temporary storage.
+# Use "./lx.zsh clean" to clean up
 
+# set -x
+
 DEFAULTDOC="paper"
 COMPILER="pdflatex"
 
@@ -32,6 +35,8 @@
 [[ ${DOC} == "" ]] && DOC=${DEFAULTDOC}
 [[ ${MAKE_PDF} == "yes" ]] && MAKE_PS="yes"
 
+
+
 clean()
 {
     local t
@@ -58,6 +63,24 @@
     done
 }
 
+shoot()
+# print out an array loaded by scan()
+{
+  local i
+  local N
+  N=$( eval print '${#'$1'}' )
+    # print N $N
+  for (( i=1 ; i <= N ; i++ ))
+  do
+    eval print -- "$"${1}"["${i}"]"
+  done
+}
+
+check_bib_missing()
+{
+  awk '$0 ~ /Warn.*database entry/ { gsub(/\"/, "", $8); print "No entry for: " $8; }'
+}
+
 biblio()
 {
   if [[ -f ${DOC}.bbl &&
@@ -65,19 +88,19 @@
    then
     rm ${DOC}.bbl
   fi
-  if { bibtex ${DOC} > ${BIB} }
+  if { bibtex ${DOC} >& ${BIB} }
    then
     printf "."
-    ${COMPILER} ${DOC} > /dev/null
+    ${COMPILER} ${DOC} >& /dev/null
     printf "."
-    ${COMPILER} ${DOC} > ${TMP}
+    ${COMPILER} ${DOC} >& ${TMP}
     printf "."
-    WARNS=( $( grep "Warning--" ${BIB} ) )
+    check_bib_missing < ${BIB} | scan WARNS
     if (( ${#WARNS} > 0 ))
       then
       printf "\n"
       print "Bibtex:"
-      print ${WARNS}
+      shoot WARNS
     fi
   else
     printf "\n"
@@ -127,11 +150,10 @@
         -f error                     ||
            ${DOC}.tex -nt ${DOC}.dvi ||
 	   lx.zsh     -nt ${DOC}.dvi ||
-           dht.bib    -nt ${DOC}.dvi ||
 	   $( readlink Wozniak.bib ) -nt ${DOC}.dvi ||
 	   ${FORCE} == "yes" ]]
  then
-  if { ${COMPILER} --interaction nonstopmode ${DOC} > ${TMP} }
+  if { ${COMPILER} --interaction nonstopmode ${DOC} >& ${TMP} }
    then
     printf "OK"
     rm -f error




More information about the Swift-commit mailing list