]> git.donarmstrong.com Git - lilypond.git/commitdiff
Initial reduction of make doc op - Issue 2075
authorPhil Holmes <mail@philholmes.net>
Sun, 4 Dec 2011 16:08:35 +0000 (16:08 +0000)
committerPhil Holmes <mail@philholmes.net>
Sat, 17 Dec 2011 13:46:56 +0000 (13:46 +0000)
Some initial changes to implement Issue 2075

make/lilypond-vars.make
make/ly-rules.make
make/lysdoc-targets.make
python/lilylib.py
scripts/lilypond-book.py

index cf1bc11203487102b4c3bb39d569aae1445a81fc..57cddb16ee37c75cd6cf850deed8cf1430e3d4cb 100644 (file)
@@ -55,13 +55,13 @@ $(LANG_TEXIDOC_FLAGS) \
 -danti-alias-factor=$(ANTI_ALIAS_FACTOR)
 
 ifdef QUIET_BUILD
-LILYPOND_BOOK_VERBOSE =
+LILYPOND_BOOK_WARN = --loglevel=NONE
 else
-LILYPOND_BOOK_VERBOSE = --verbose
+LILYPOND_BOOK_WARN = --loglevel=WARN
 endif
 
 LILYPOND_BOOK_INFO_IMAGES_DIR = $(if $(INFO_IMAGES_DIR),--info-images-dir=$(INFO_IMAGES_DIR),)
-LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_VERBOSE) $(LILYPOND_BOOK_INFO_IMAGES_DIR)
+LILYPOND_BOOK_FLAGS = $(LILYPOND_BOOK_WARN) $(LILYPOND_BOOK_INFO_IMAGES_DIR)
 
 ifeq ($(out),)
 LILYPOND_BOOK_PROCESS = true
index 0df0643ee3158ec5ad2c0a685d752942ea30d18e..a876b04f1864ea548e03997b35aecccbed5bbcbd 100644 (file)
@@ -22,11 +22,11 @@ $(eval $(firstword $(TEXI_FILES_FROM_TELY)):\
 # don't do ``cd $(outdir)'', and assume that $(outdir)/.. is the src dir.
 # it is not, for --srcdir builds
 $(outdir)/%.texi: %.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
-       LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
+       LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) --redirect-lilypond-output $<
 
 
 $(outdir)/%.texi: $(outdir)/%.tely $(outdir)/version.itexi $(DOCUMENTATION_LOCALE_TARGET) $(INIT_LY_SOURCES) $(SCHEME_SOURCES)
-       LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) $<
+       LILYPOND_VERSION=$(TOPLEVEL_VERSION) $(PYTHON) $(LILYPOND_BOOK) $(LILYPOND_BOOK_INCLUDES) --process='$(LILYPOND_BOOK_PROCESS) $(LILYPOND_BOOK_INCLUDES) $(LILYPOND_BOOK_LILYPOND_FLAGS)' --output=$(outdir) --format=$(LILYPOND_BOOK_FORMAT) $(LILYPOND_BOOK_FLAGS) --redirect-lilypond-output $<
 
 
 $(outdir)/%.html.omf: %.tely
index e39fa1c58bc047a626e8ef32abe649a40e95550c..5290e3962feb6cbc06192050791facc66f2349fe 100644 (file)
@@ -16,6 +16,6 @@ local-test:
                echo -e '\n\n\n' ; \
                (cd $(top-src-dir) && git diff ) ; \
        fi > $(outdir)/tree.gittxt
-       $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_VERBOSE= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
+       $(MAKE) LILYPOND_BOOK_LILYPOND_FLAGS="-dbackend=eps --formats=ps $(LILYPOND_JOBS) -dseparate-log-files -dinclude-eps-fonts -dgs-load-lily-fonts --header=texidoc -I $(top-src-dir)/Documentation/included/ -ddump-profile -dcheck-internal-types -ddump-signatures -danti-alias-factor=1" LILYPOND_BOOK_WARN= $(outdir)/collated-files.html LYS_OUTPUT_DIR=$(top-build-dir)/out/lybook-testdb
        rsync -L -a --exclude 'out-*' --exclude 'out' --exclude mf --exclude source --exclude mf $(top-build-dir)/out/share $(outdir)
 
index 7a36a8aaace6ab8cce1b09d8044dc61ced22b38a..0f33ed4a2cde2bf5b7e147ae0366afa249bf275c 100644 (file)
@@ -179,7 +179,7 @@ def subprocess_system (cmd,
     error_log_file = ''
 
     if redirect_output:
-        progress (_ ("Processing %s.ly") % log_file)
+        progress (_ ("Processing %s.ly \n") % log_file)
     else:
         if be_verbose:
             show_progress = 1
@@ -193,9 +193,7 @@ def subprocess_system (cmd,
         stdout_setting = subprocess.PIPE
 
     if redirect_output:
-        stdout_filename = ' '.join([log_file, '.log'])
-        stderr_filename = ' '.join([log_file, '.err.log'])
-        stdout_setting = open(stdout_filename, 'w')
+        stderr_filename = log_file + '.log'
         stderr_setting = open(stderr_filename, 'w')
 
     proc = subprocess.Popen (cmd,
@@ -208,9 +206,8 @@ def subprocess_system (cmd,
 
     if redirect_output:
         while proc.poll()==None:
-            time.sleep(1)
+            time.sleep(0.01)
         retval = proc.returncode
-        stdout_setting.close()
         stderr_setting.close()
     else:
         if show_progress:
@@ -227,7 +224,7 @@ def subprocess_system (cmd,
             print >>sys.stderr, "Child returned", retval
 
         if ignore_error:
-            print >>sys.stderr, "Error ignored"
+            print >>sys.stderr, "Error ignored by lilylib"
         else:
             if not show_progress:
                 print log[0]
index 69156d715e7f4c100f64dd628354a2bbb19adb49..78e9130b07b46be46df4c1fcfb6f3f637220db34 100644 (file)
@@ -380,11 +380,19 @@ def system_in_directory (cmd, directory, logfile):
 
     current = os.getcwd()
     os.chdir (directory)
-    ly.system(cmd,
+    """NB - ignore_error is deliberately set to the same value
+    as redirect_output - this is not a typo."""
+    retval = ly.system(cmd,
               be_verbose=ly.is_verbose (),
               redirect_output=global_options.redirect_output,
               log_file=logfile,
-              progress_p=1)
+              progress_p=1,
+              ignore_error=global_options.redirect_output)
+    if retval != 0:
+        print ("Error trapped by lilypond-book")
+        print ("\nPlease see " + logfile + ".log\n")
+        sys.exit(1)
+
     os.chdir (current)