On 17/06/2011 3:10 PM, Graham Percival wrote:
On Fri, Jun 17, 2011 at 07:35:19PM +0100, Graham Percival wrote:
On Fri, Jun 17, 2011 at 02:18:55PM -0400, Julien Rioux wrote:
On 17/06/2011 2:11 PM, Graham Percival wrote:
make ...blah... || echo "build failed"&& tail logfile
but then when blah fails, make will not stop, since the return
status from echo&& tail is a success (assuming the log file
exists). How would you return failure and force make to stop?
...
The short answer is that I cannot believe that we've exhausted all
options yet. I want Phil to look into those options; of course I
welcome any suggestions from people on this list. But off the top
of my head, I'd say that we can't possibly say that we're out of
ideas until we've spent at least 5 hours googling and/or reading
documentation about make and/or experimenting with make and
stepmake.
ok, I've got a simple solution which avoids all
bash/sh/make/stepmake confusion altogether: write a simple
(5-line?) python script. The script is basically just
import sys
cmd = sys.argv[1]
target = sys.argv[2]
status = os.system(cmd+" "+target)
if not status:
print "Something went wrong! Look in",
print target.replace(".ly", ".log")
sys.exit(1)
sys.exit(0) # success
(not tested)
Now, that's a totally gratuitious use of python... but OTOH, why
not? We already require python, and we use it for tons of other
stuff... and really, a
compile-lilypond-book-file-with-warning-about-log.py
script would be *far* easier for casual hackers to read+understand
than all that make and sh garbage. (ok, the script name is a bit
long, but that's easily thought about)
ok, there we go. We have a backup plan. I'm not wedded to the
"small python script" idea, but if all else fails, it will
definitely work. There might be a better solution out there; I'm
happy to hear alternatives.
Cheers,
- Graham
Hmm, sure that's one way. However, you guys control the source code of
lilypond, so that you can make this change in the lilypond binary itself
instead of using any kind of indirect way you can imagine to call
lilypond and then cat its log file. Why not make lilypond, maybe with
the --log command-line flag, behave in the way you really want, i.e., as
I understand it all output goes to the .log file and error output (but
not progress output) also goes to stderr, with the mention of the log
filename.
Regards,
Julien
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel