]> git.donarmstrong.com Git - lilypond.git/commitdiff
Add --no-lily-run option to lilypond-book.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Mar 2008 03:04:32 +0000 (00:04 -0300)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Tue, 25 Mar 2008 03:04:32 +0000 (00:04 -0300)
make/lilypond-vars.make
scripts/lilypond-book.py

index e6f12ba7b03d7ef295ea6db3258217caeba05560..6932c718f7164d72fa43e2c583658cc94fe131c5 100644 (file)
@@ -37,6 +37,7 @@ LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE) $(LILYPOND_BOOK_INFO_IMAGES_DIR)
 
 ifeq ($(out),)
 LILYPOND_BOOK_PROCESS = true
+LILYPOND_BOOK_FLAGS = --no-lily-run
 else
 LILYPOND_BOOK_PROCESS = $(LILYPOND_BINARY)
 endif
index 521024e13e9fef9c58a6d630651225a6273e3048..5e16f6b3971db50e4ebfd8133a6160676c6bef0f 100644 (file)
@@ -146,6 +146,12 @@ def get_option_parser ():
                   action='store', dest='output_dir',
                   default='')
     
+    p.add_option ('--no-lily-run',
+                  help=_ ("do not fail if no lilypond output is found."),
+                  metavar=_ ("DIR"),
+                  action='store_true', dest='skip_lilypond_run',
+                  default=False)
+    
     p.add_option ('--lily-output-dir',
                   help=_ ("write lily-XXX files to DIR, link into --output dir."),
                   metavar=_ ("DIR"),
@@ -1117,6 +1123,9 @@ class LilypondSnippet (Snippet):
 
     def link_all_output_files (self, output_dir, output_dir_files, destination):
         existing = self.all_output_files (output_dir, output_dir_files)
+        if existing is None:
+            print '\nMissing', self.basename()
+            raise CompileError(self.basename())
         for name in existing:
             try:
                 os.unlink (os.path.join (destination, name))
@@ -1148,12 +1157,14 @@ class LilypondSnippet (Snippet):
                 raise Missing
             result.add (name)
 
+        skip_lily = global_options.skip_lilypond_run
         try:
             for required in [base + '.ly',
-                             base + '.txt',
-                             base + '-systems.count']:
+                             base + '.txt']:
                 require_file (required)
-
+            if not skip_lily:
+                require_file (base + '-systems.count')
+                
             map (consider_file, [base + '.tex',
                                  base + '.eps',
                                  base + '.texidoc',
@@ -1168,8 +1179,10 @@ class LilypondSnippet (Snippet):
                 else:
                     for page in range (1, page_count + 1):
                         require_file (base + '-page%d.png' % page)
-
-            system_count = int(file (full + '-systems.count').read())
+             
+            system_count = 0
+            if not skip_lily:
+                system_count = int(file (full + '-systems.count').read())
             for number in range(1, system_count + 1):
                 systemfile = '%s-%d' % (base, number)
                 require_file (systemfile + '.eps')