diff options
Diffstat (limited to 'src/engine/SCons/Tool/tex.py')
-rw-r--r-- | src/engine/SCons/Tool/tex.py | 31 |
1 files changed, 5 insertions, 26 deletions
diff --git a/src/engine/SCons/Tool/tex.py b/src/engine/SCons/Tool/tex.py index 15e2d3e..1e78bb5 100644 --- a/src/engine/SCons/Tool/tex.py +++ b/src/engine/SCons/Tool/tex.py @@ -128,7 +128,10 @@ modify_env_var = SCons.Scanner.LaTeX.modify_env_var def FindFile(name,suffixes,paths,env,requireExt=False): if requireExt: - name = SCons.Util.splitext(name)[0] + name,ext = SCons.Util.splitext(name) + # if the user gave an extension use it. + if ext: + name = name + ext if Verbose: print " searching for '%s' with extensions: " % name,suffixes @@ -178,6 +181,7 @@ def InternalLaTeXAuxAction(XXXLaTeXAction, target = None, source= None, env=None basedir = os.path.split(str(source[0]))[0] basefile = os.path.split(str(basename))[1] abspath = os.path.abspath(basedir) + targetext = os.path.splitext(str(target[0]))[1] targetdir = os.path.split(str(target[0]))[0] @@ -430,31 +434,6 @@ def ScanFiles(theFile, target, paths, file_tests, file_tests_search, env, graphi if file_tests[i][0] == None: file_tests[i][0] = file_tests_search[i].search(content) - # For each file see if any graphics files are included - # and set up target to create ,pdf graphic - # is this is in pdflatex toolchain - graphic_files = includegraphics_re.findall(content) - if Verbose: - print "graphics files in '%s': "%str(theFile),graphic_files - for graphFile in graphic_files: - graphicNode = FindFile(graphFile,graphics_extensions,paths,env,requireExt=True) - # if building with pdflatex see if we need to build the .pdf version of the graphic file - # I should probably come up with a better way to tell which builder we are using. - if graphics_extensions == LatexGraphics: - # see if we can build this graphics file by epstopdf - graphicSrc = FindFile(graphFile,TexGraphics,paths,env,requireExt=True) - # it seems that FindFile checks with no extension added - # so if the extension is included in the name then both searches find it - # we don't want to try to build a .pdf from a .pdf so make sure src!=file wanted - if (graphicSrc != None) and (graphicSrc != graphicNode): - if Verbose: - if graphicNode == None: - print "need to build '%s' by epstopdf %s -o %s" % (graphFile,graphicSrc,graphFile) - else: - print "no need to build '%s', but source file %s exists" % (graphicNode,graphicSrc) - graphicNode = env.PDF(graphicSrc) - env.Depends(target[0],graphicNode) - # recursively call this on each of the included files inc_files = [ ] inc_files.extend( include_re.findall(content) ) |