]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/bib2texi.py
Build: Better error handling from build scripts.
[lilypond.git] / scripts / build / bib2texi.py
index ab8a6b902be6752e2a0aedb1298c3baf3428d340..c71976dec123f64b50457d055ffa45dd6f5aa14a 100644 (file)
@@ -69,15 +69,21 @@ cmd = "TEXMFOUTPUT=%s bibtex %s %s" % (tmpdir, quiet_flag, tmpfile)
 
 if (show_output):
     sys.stdout.write ("Running bibtex on %s\n" % files)
+    sys.stdout.write (cmd)
 #And invoke it
 stat = os.system (cmd)
 if stat <> 0:
-    sys.exit(1)
+    sys.stderr.write ("Bibtex exited with nonzero exit status!")
+    sys.exit (1)
 
 #TODO: do tex -> itexi on output
-# Following lines copy tmpfile.bbl to the desired output file
+# Following lines copy tmpfile.bbl to the desired output file
 bbl = open (tmpfile + '.bbl').read ()
 
+if bbl.strip () == '':
+    sys.stderr.write ("Bibtex generated an empty file!")
+    sys.exit (1)
+
 open (output, 'w').write  (bbl)
 
 def cleanup (tmpfile):