X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=buildscripts%2Fmass-link.py;h=17412e5559f6aa7b34a0a17c5e1561703aaa3bff;hb=a32c2915e1371906a076ab94f341ea3dac0597e7;hp=113495512d8c7394d0356efd05cc7f5694b4be3d;hpb=fe261ab5648aa9827f66a72f14d1fe0422a96308;p=lilypond.git diff --git a/buildscripts/mass-link.py b/buildscripts/mass-link.py index 113495512d..17412e5559 100644 --- a/buildscripts/mass-link.py +++ b/buildscripts/mass-link.py @@ -54,11 +54,14 @@ def relative_path (f): return f return f[len (source_dir) + 1:] -destfiles = map (lambda f: os.path.join (dest_dir, insert_suffix (relative_path (f))), sourcefiles) +destfiles = [os.path.join (dest_dir, insert_suffix (relative_path (f))) for f in sourcefiles] + +destdirs = set ([os.path.dirname (dest) for dest in destfiles]) +[os.makedirs (d) for d in destdirs if not os.path.exists (d)] def force_link (src,dest): if os.path.exists (dest): - os.system ('rm -rf ' + dest) + os.system ('rm -f ' + dest) link (src, dest) map (force_link, sourcefiles, destfiles)