Makefile: shadow the phsource and dictsource directories instead of copying them

This commit is contained in:
Reece Dunn
2011-12-26 20:19:25 +00:00
parent 0644df4e0d
commit 550e3fb2e8
2 changed files with 25 additions and 3 deletions
Executable
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/python
#
# Copyright (C) 2011 Reece H. Dunn
# Licence: GPLv3
#
# A script for shadowing a directory tree to another (equivalent to lndir).
import sys
import os
def shadow(src, dst):
if not os.path.exists(dst):
os.makedirs(dst)
for fn in os.listdir(src):
srcpath = os.path.join(src, fn)
dstpath = os.path.join(dst, fn)
if os.path.isdir(srcpath):
shadow(srcpath, dstpath)
else:
os.symlink(srcpath, dstpath)
shadow(sys.argv[1], sys.argv[2])