Prevent static file name linking from operating on symlinks.

This commit is contained in:
Max Goodman
2011-06-21 12:36:07 -07:00
parent 83a3e09716
commit 628f92af9d
2 changed files with 4 additions and 3 deletions

View File

@@ -78,7 +78,7 @@ all: pyx static names $(INIS)
.PHONY: pyx js css rtl static names clean clean_static all
$(NAMES): static
$(NAMES): $(JSTARGETS) $(CSSTARGETS) $(SPRITES) $(MAINCSS)
$(UPDATE_NAMES) $(NAMES) $(NAMED)
$(JSTARGETS): $(JSSOURCES)

View File

@@ -27,8 +27,9 @@ def update_static_names(names_file, files, make_links=False):
base = os.path.dirname(names_file)
for path in files:
name = os.path.relpath(path, base)
names[name] = generate_static_name(name, base)
if not os.path.islink(path):
name = os.path.relpath(path, base)
names[name] = generate_static_name(name, base)
json_enc = json.JSONEncoder(indent=2, sort_keys=True)
open(names_file, "w").write(json_enc.encode(names))