]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/www_post.py
Update lilygit.tcl (Issue 2092)
[lilypond.git] / scripts / build / www_post.py
index 17af63109edf3d3728ed44c5a49a1e77452cf21f..784a978f20dafc9ffbaa22488caaf1b7451fbf2f 100644 (file)
@@ -47,9 +47,15 @@ dirs, symlinks, files = mirrortree.walk_tree (
 # actual mirrorring stuff
 html_files = []
 hardlinked_files = []
+# These whitelisted files actually do contain the string
+# 'UNTRANSLATED NODE: IGNORE ME' for documentation purposes.
+whitelisted_files = [
+    'Documentation/out-www/contributor-big-page.html',
+    'Documentation/out-www/contributor/website-build.html',
+]
 for f in files:
     if f.endswith ('.html'):
-        if not 'UNTRANSLATED NODE: IGNORE ME' in open (f).read ():
+        if f in whitelisted_files or not 'UNTRANSLATED NODE: IGNORE ME' in open (f).read ():
             html_files.append (f)
     else:
         hardlinked_files.append (f)
@@ -64,14 +70,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)