static Makefile: Work around NFS hardlink bug.

This commit is contained in:
Ricky Ramirez
2013-02-04 23:33:37 -08:00
parent b291f5e040
commit 74fb7c2d78

View File

@@ -61,6 +61,11 @@ def update_static_names(names_file, files):
if not os.path.islink(path):
mangled_path = os.path.join(base, mangled_name)
shutil.move(path, mangled_path)
# When on NFS, cp has a bad habit of turning our symlinks into
# hardlinks. shutil.move will then call rename which will noop in
# the case of hardlinks to the same inode.
if os.path.exists(path):
os.unlink(path)
os.symlink(mangled_name, path)
json_enc = json.JSONEncoder(indent=2, sort_keys=True)