]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/lilypond-book.py
Docs-fr: fix PDF docs build
[lilypond.git] / scripts / lilypond-book.py
index 0916ce1741d6058416d0a5b5dc85bcdad48ba1a1..d52e09ad2f2725c201523bd0f783b3a0d8190724 100644 (file)
@@ -126,7 +126,7 @@ def warranty ():
 
 %s
 %s
-''' % ( _ ('Copyright (c) %s by') % '2001--2009',
+''' % ( _ ('Copyright (c) %s by') % '2001--2010',
         '\n  '.join (authors),
         _ ("Distributed under terms of the GNU General Public License."),
         _ ("It comes with NO WARRANTY.")))
@@ -164,7 +164,8 @@ def get_option_parser ():
                   default='')
 
     p.add_option ('--latex-program',
-                  help=_ ("run executable PROG instead of latex"),
+                  help=_ ("run executable PROG instead of latex, or in\n\
+case --pdf option is set instead of pdflatex"),
                   metavar=_ ("PROG"),
                   action='store', dest='latex_program',
                   default='latex')
@@ -1203,11 +1204,10 @@ left-margin-default right-margin-default)"
 
         option_list = []
         for option in self.get_option_list ():
-            for name in PROCESSING_INDEPENDENT_OPTIONS:
-                if not option.startswith (name):
-                    option_list.append (option)
+            if not any (option.startswith (name)
+                        for name in PROCESSING_INDEPENDENT_OPTIONS):
+                option_list.append (option)
         option_string = ','.join (option_list)
-
         compose_dict = {}
         compose_types = [NOTES, PREAMBLE, LAYOUT, PAPER]
         for a in compose_types:
@@ -1284,8 +1284,10 @@ left-margin-default right-margin-default)"
             hash = md5 (self.relevant_contents (self.ly ()))
             for option in self.get_option_list ():
                 for name in PROCESSING_INDEPENDENT_OPTIONS:
-                    if not option.startswith (name):
-                        hash.update (option)
+                    if option.startswith (name):
+                        break
+                else:
+                    hash.update (option)
 
             ## let's not create too long names.
             self.checksum = hash.hexdigest ()[:10]
@@ -1308,7 +1310,7 @@ left-margin-default right-margin-default)"
         filename = path + '.ly'
         if os.path.exists (filename):
             diff_against_existing = filter_pipe (self.full_ly (), 'diff -u %s -' % filename)
-            if not diff_against_existing.startswith ('\n'):
+            if diff_against_existing:
                 warning ("%s: duplicate filename but different contents of orginal file,\n\
 printing diff against existing file." % filename)
                 ly.stderr_write (diff_against_existing)
@@ -2150,6 +2152,8 @@ def main ():
         global_options.process_cmd += ' --formats=eps '
         if global_options.create_pdf:
             global_options.process_cmd += "--pdf -dinclude-eps-fonts -dgs-load-fonts "
+            if global_options.latex_program == 'latex':
+                global_options.latex_program = 'pdflatex'
 
     if global_options.verbose:
         global_options.process_cmd += " --verbose "