From b4118379dafd0adf8c03468ff758355cd9f7e5de Mon Sep 17 00:00:00 2001
From: fred <fred>
Date: Wed, 27 Mar 2002 02:07:04 +0000
Subject: [PATCH] lilypond-1.5.43

---
 scripts/ly2dvi.py | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/scripts/ly2dvi.py b/scripts/ly2dvi.py
index 43dd994891..d428202869 100644
--- a/scripts/ly2dvi.py
+++ b/scripts/ly2dvi.py
@@ -359,17 +359,13 @@ track_dependencies_p = 0
 dependency_files = []
 
 
-#
-# Try to cater for bad installations of LilyPond, that have
-# broken TeX setup.  Just hope this doesn't hurt good TeX
-# setups.  Maybe we should check if kpsewhich can find
-# feta16.{afm,mf,tex,tfm}, and only set env upon failure.
-#
+
+kpse = os.popen ('kpsexpand \$TEXMF').read()
+kpse = re.sub('[ \t\n]+$','', kpse)
+
 environment = {
-	'MFINPUTS' : datadir + '/mf' + ':',
-	'TEXINPUTS': datadir + '/tex:' + datadir + '/ps:' + '.:'
-		+ os.getcwd() + ':',
-	'TFMFONTS' : datadir + '/tfm' + ':',
+	## todo: prevent multiple addition.
+	'TEXMF' : "{%s,%s}" % (datadir, kpse) ,
 	'GS_FONTPATH' : datadir + '/afm:' + datadir + '/pfa',
 	'GS_LIB' : datadir + '/ps',
 }
-- 
2.39.5