summaryrefslogtreecommitdiff
path: root/scripts/build/www_post.py
diff options
context:
space:
mode:
authorPhil Holmes <mail@philholmes.net>2012-01-15 14:19:45 +0000
committerPhil Holmes <mail@philholmes.net>2012-01-15 14:31:34 +0000
commit1a062ada6baa754c009dc16fafb0542e80d4fd1f (patch)
tree2789fed8dadc77a940806ff209b2e315e86d5cd1 /scripts/build/www_post.py
parent0cc0c4fb20b70e717db7e8f43cbb0c1878cd8395 (diff)
Final version of not always copying html files
Diffstat (limited to 'scripts/build/www_post.py')
-rw-r--r--scripts/build/www_post.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/scripts/build/www_post.py b/scripts/build/www_post.py
index fec7f0e20c..7ec91dd80b 100644
--- a/scripts/build/www_post.py
+++ b/scripts/build/www_post.py
@@ -70,10 +70,15 @@ 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)