#15190 closed (fixed)
collectstatic should not symlink files that are already symlinked
Reported by: | Ben Davis | Owned by: | Jannis Leidel |
---|---|---|---|
Component: | contrib.staticfiles | Version: | 1.3-beta |
Severity: | Keywords: | staticfiles | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
For whatever reason, collectstatic re-symlinks files that are already symlink. If the symlink already exists, it should skip and move on to the next. This can become tiresome during deployments that have hundreds of static files.
Attachments (1)
Change History (7)
comment:1 by , 14 years ago
milestone: | → 1.3 |
---|---|
Triage Stage: | Unreviewed → Accepted |
comment:2 by , 14 years ago
Component: | Contrib apps → django.contrib.staticfiles |
---|
comment:3 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:4 by , 14 years ago
Has patch: | set |
---|
The attached patch solves a few problems of collectstatic:
- Reliance on set() and therefor not guaranteed order
- Deleting symlinks even if they refer to the same files
- Code smell, such as missing comments
- Shows which directory it copies/links now
Note:
See TracTickets
for help on using tickets.
Yeah, that seems like a good idea, although we probably want to make sure that the existing symlink points to the wanted source file (e.g. with os.path.exists and/or os.path.realpath).