From 032a4bdd7897db8a409fe70475be93ef08859c3a Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 4 Aug 2017 09:34:59 +0530 Subject: [PATCH] Dont build PDF version of manual in Turkish as sphinx produces broken Tex output for that language --- manual/build.py | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/manual/build.py b/manual/build.py index 2f906800b6..20d578b81b 100755 --- a/manual/build.py +++ b/manual/build.py @@ -41,6 +41,7 @@ def sphinx_build(language, base, builder='html', bdir='html', t=None, quiet=True def build_manual(language, base): sb = partial(sphinx_build, language, base) + skip_pdf = language == 'tr' onlinedir = sb(t='online') epubdir = sb('myepub', 'epub') latexdir = sb('mylatex', 'latex') @@ -52,20 +53,22 @@ def build_manual(language, base): p.stdin.close() return p.wait() try: - for i in xrange(3): - run_cmd(['pdflatex', '-interaction=nonstopmode', 'calibre.tex']) - run_cmd(['makeindex', '-s', 'python.ist', 'calibre.idx']) - for i in xrange(2): - run_cmd(['pdflatex', '-interaction=nonstopmode', 'calibre.tex']) - if not os.path.exists('calibre.pdf'): - print('Failed to build pdf file, see calibre.log in the latex directory', file=sys.stderr) - raise SystemExit(1) + if not skip_pdf: + for i in xrange(3): + run_cmd(['pdflatex', '-interaction=nonstopmode', 'calibre.tex']) + run_cmd(['makeindex', '-s', 'python.ist', 'calibre.idx']) + for i in xrange(2): + run_cmd(['pdflatex', '-interaction=nonstopmode', 'calibre.tex']) + if not os.path.exists('calibre.pdf'): + print('Failed to build pdf file, see calibre.log in the latex directory', file=sys.stderr) + raise SystemExit(1) finally: os.chdir(pwd) epub_dest = j(onlinedir, 'calibre.epub') pdf_dest = j(onlinedir, 'calibre.pdf') shutil.copyfile(j(epubdir, 'calibre.epub'), epub_dest) - shutil.copyfile(j(latexdir, 'calibre.pdf'), pdf_dest) + if not skip_pdf: + shutil.copyfile(j(latexdir, 'calibre.pdf'), pdf_dest) epub_to_azw3(epub_dest)