X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fbuild-listerrors;h=9776b028d31d705cf3719e2a63428e4a6a08bd08;hb=22a8b82ad53614edbd3d4a67722437d7c98d5a51;hp=629d031f19c4222e1e2e2cf4ca4be44704518045;hpb=d02a3f2679f0f2e0c6af50155c3ff710e065a302;p=lyx.git diff --git a/lib/build-listerrors b/lib/build-listerrors index 629d031f19..9776b028d3 100755 --- a/lib/build-listerrors +++ b/lib/build-listerrors @@ -3,81 +3,43 @@ # Attempt to build listerrors (see examples/Literate.lyx) at build-time # # Author: Kayvan Sylvan +# +# Assume notangle is on the path -fakeprogram() -{ - L=listerrors - echo "#!/bin/sh" > $L - echo 'echo "This is NOT the listerrors program."' >> $L - echo 'echo ""' >> $L - echo 'echo "Here was the problem when we tried to build listerrors:"' >> $L - echo echo "$1" >> $L - chmod +x $L - exit 0 -} - -mywhich() -{ - arg=$1 - for i in `echo $PATH | sed 's/:/ /g'` - do - if [ -x $i/$arg ] - then - echo $i/$arg - fi - done -} - -if [ -r ../src/lyx ] +if [ $# -eq 1 ] then - lyx=../src/lyx + dir=$1 else - lyx=`mywhich lyx` + dir=. fi -if [ -z "$lyx" ] +if [ -r ../src/lyx ] then - echo "You must build lyx first to build listerrors." - exit 1 + lyx=../src/lyx +else + # Assumed to be on the path + lyx=lyx fi -notangle=`mywhich notangle` - -if [ -z "$notangle" ] +if [ -z "`grep literate-article textclass.lst`" ] then - fakeprogram "The NOWEB notangle was not found." + touch listerrors + exit 0 fi -vncserver=`mywhich vncserver` -if [ -z "$vncserver" ] +$lyx --export literate $dir/examples/Literate.lyx +# if no literate support stuff is installed nothing will be output +if [ -f $dir/examples/Literate.nw ] then - # See if DISPLAY is set - # - if [ -z "$DISPLAY" ] - then - fakeprogram "Could not export Literate.nw. Export needs GUI, fix lyx!" - else - $lyx --export tex examples/Literate.lyx - fi + mv $dir/examples/Literate.nw Literate.nw + which notangle 2>/dev/null && notangle -Rbuild-script Literate.nw | sh else - # Use the vncserver to make a silent export - if [ -r $HOME/.vnc/passwd ] - then - had_vnc_passwd=1 - else - mkdir $HOME/.vnc > /dev/null 2>&1 - had_vnc_passwd=0 - touch $HOME/.vnc/passwd; chmod 700 $HOME/.vnc/passwd - fi - $vncserver :10 -depth 16 - DISPLAY=:10 - export DISPLAY - $lyx --export tex examples/Literate.lyx - $vncserver -kill :10 - if [ $had_vnc_passwd -eq 0 ] - then - rm $HOME/.vnc/passwd - fi + # you don't have noweb installed so we'll produce a dummy file + # just so make doesn't keep trying to output it. + touch listerrors + # tell the user nothing bad happened + echo + echo "LyX did not detect NoWeb support. Proceeding normally." fi -mv examples/Literate.tex Literate.nw -$notangle -Rbuild-script Literate.nw | sh + +exit 0