]> git.donarmstrong.com Git - lilypond.git/commitdiff
LSR: improve buildscript, add directories.
authorGraham Percival <graham@percival-music.ca>
Tue, 19 Jun 2007 04:27:08 +0000 (21:27 -0700)
committerGraham Percival <graham@percival-music.ca>
Tue, 19 Jun 2007 04:27:08 +0000 (21:27 -0700)
buildscripts/makelsr.py

index 3cd1bbad0e367e4db6b72b5cc2f13498db231963..748f35f651f0ee3d9f5f0a8b72010f185de749bf 100755 (executable)
@@ -6,6 +6,7 @@ import shutil
 
 dirs = ['ancient','chords','connecting','contemporary','expressive','education','guitar','parts','pitch','repeats','scheme','spacing','staff','text','vocal','other','non-music','engravers','instrument-specific']
 notsafe=[]
+notconvert=[]
 
 try:
        in_dir = sys.argv[1]
@@ -19,6 +20,8 @@ def copy_with_warning(src, dest):
 
 
 def copy_dir_with_test(srcdir, destdir):
+       global notsafe
+       global notconvert
        if not(os.path.exists(srcdir)):
                return
        file_names = os.listdir (srcdir)
@@ -27,8 +30,14 @@ def copy_dir_with_test(srcdir, destdir):
                        src = os.path.join (srcdir, file)
                        dest = os.path.join (destdir, file)
                        copy_with_warning(src, dest)
-                       os.system('convert-ly -e ' + dest)
-                       s = os.system('nice lilypond -dno-print-pages -dsafe -o /tmp/lsrtest ' + dest)
+                       s = os.system('convert-ly -e ' + dest)
+                       if os.path.exists( dest + '~' ):
+                               os.remove( dest + '~' )
+                       if s:
+                               notconvert.append(dest)
+                       # the -V seems to make unsafe snippets fail nicer/sooner.
+                       s = os.system('nice lilypond -V -dno-print-pages -dsafe -o /tmp/lsrtest ' + dest)
+                       #s = os.system('nice lilypond -dno-print-pages -dsafe -o /tmp/lsrtest ' + dest)
                        if s:
                                notsafe.append(dest)
 
@@ -52,11 +61,20 @@ for dir in dirs:
        copy_dir_with_test( os.path.join ('input', 'new', dir), destdir )
 
 
+file=open("not-converted.txt", 'w')
+for s in notconvert:
+       file.write(s+'\n')
+file.close()
+
 file=open("lsr-unsafe.txt", 'w')
 for s in notsafe:
        file.write(s+'\n')
 file.close()
+
+print
 print
+print "List of files that could not be automatically updated printed",
+print "in not-converted.txt: CHECK MANUALLY!"
 print
 print "Unsafe files printed in lsr-unsafe.txt: CHECK MANUALLY!"
 print "  xargs git-diff < lsr-unsafe.txt"