]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/www_post.py
Change all occurences of "echo -n" to "printf" for portability
[lilypond.git] / scripts / build / www_post.py
index fec7f0e20cd144eda3bb99b02dd0a0ee38575aec..c62e02145a10001ce095d73b851be94d7f5e6a7d 100644 (file)
@@ -43,6 +43,14 @@ dirs, symlinks, files = mirrortree.walk_tree (
         '|'.join ([l.code for l in langdefs.LANGUAGES]) + '))(/|$)',
     find_files = r'.*?\.(?:midi|html|pdf|png|jpe?g|txt|i?ly|signature|css|zip|js|..\.idx|php)$|VERSION',
     exclude_files = r'lily-[0-9a-f]+.*\.(pdf|txt)')
+# extra files: info and tex output from lilypond-book regtests
+extra_files = mirrortree.walk_tree (
+    tree_roots = ['input/regression/lilypond-book'],
+    process_dirs = outdir,
+    exclude_dirs = r'(^|/)(out|out-test)(/|$)',
+    find_files = r'.+\.(info|tex)$',
+    exclude_files = r'lily-[0-9a-f]+.*\.tex')[2]
+files.extend(extra_files)
 
 # actual mirrorring stuff
 html_files = []
@@ -70,14 +78,19 @@ strip_re = re.compile (outdir + '/')
 for t in targets:
     out_root = target_pattern % t
     strip_file_name[t] = lambda s: os.path.join (target_pattern % t, (strip_re.sub ('', s)))
-    os.mkdir (out_root)
-    map (os.mkdir, [os.path.join (out_root, d) for d in dirs])
+    if not os.path.exists (out_root):
+        os.mkdir (out_root)
+    for d in dirs:
+        new_dir = os.path.join (out_root, d)
+        if not os.path.exists (new_dir):
+            os.mkdir (new_dir)
     for f in hardlinked_files:
-        os.link (f, strip_file_name[t] (f))
+        if not os.path.isfile (strip_file_name[t] (f)):
+            os.link (f, strip_file_name[t] (f))
     for l in symlinks:
         p = mirrortree.new_link_path (os.path.normpath (os.readlink (l)), os.path.dirname (l), strip_re)
         dest = strip_file_name[t] (l)
-        if not os.path.exists (dest):
+        if not os.path.lexists (dest):
             os.symlink (p, dest)