From 38927eb419eb10edddcef9be6a7ee17455c81638 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Mon, 6 Jan 2003 17:40:46 +0000 Subject: [PATCH] If we bother to test for the presence of latex, then the test should work... git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5907 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/ChangeLog | 5 +++++ lib/scripts/lyxpreview2bitmap.sh | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/ChangeLog b/lib/ChangeLog index 8c61fce784..e19377bf96 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2003-01-06 Angus Leeming + + * scripts/lyxpreview2bitmap.sh: don't use 'which' to find an executable. + Use 'type'. + 2003-01-05 John Levon * lyx2lyx/lyxconvert_215.py: handle \lyxrcsid, \lyxvcid, \cursor diff --git a/lib/scripts/lyxpreview2bitmap.sh b/lib/scripts/lyxpreview2bitmap.sh index 7e203a5c03..7e4ece1f96 100644 --- a/lib/scripts/lyxpreview2bitmap.sh +++ b/lib/scripts/lyxpreview2bitmap.sh @@ -54,9 +54,10 @@ # Three helper functions. FIND_IT () { - which ${EXECUTABLE} > /dev/null || - { - echo "Unable to find \"${EXECUTABLE}\". Please install." + test $# -eq 1 || exit 1 + + type $1 > /dev/null || { + echo "Unable to find \"$1\". Please install." exit 1 } } @@ -100,9 +101,9 @@ else fi # We use latex, dvips and gs, so check that they're all there. -EXECUTABLE=latex; FIND_IT -EXECUTABLE=dvips; FIND_IT -EXECUTABLE=gs; FIND_IT +FIND_IT latex +FIND_IT dvips +FIND_IT gs # Initialise some variables. TEXFILE=${BASE}.tex @@ -202,7 +203,7 @@ rm -f ${FILES} texput.log # The bitmap files can have large amounts of whitespace to the left and # right. This can be cropped if so desired. CROP=1 -which pnmcrop > /dev/null || CROP=0 +type pnmcrop > /dev/null || CROP=0 # There's no point cropping the image if using PNG images. If you want to # crop, use PPM. -- 2.39.2