Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#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)

15190.1.diff (10.8 KB ) - added by Jannis Leidel 13 years ago.
refactored collectstatic command

Download all attachments as: .zip

Change History (7)

comment:1 by Jannis Leidel, 13 years ago

milestone: 1.3
Triage Stage: UnreviewedAccepted

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).

comment:2 by Jannis Leidel, 13 years ago

Component: Contrib appsdjango.contrib.staticfiles

comment:3 by Jannis Leidel, 13 years ago

Owner: changed from nobody to Jannis Leidel
Status: newassigned

by Jannis Leidel, 13 years ago

Attachment: 15190.1.diff added

refactored collectstatic command

comment:4 by Jannis Leidel, 13 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

comment:5 by Jannis Leidel, 13 years ago

Resolution: fixed
Status: assignedclosed

In [15388]:

Fixed #15190 -- Refactored the collectstatic command to improve the symlink mode and generally straighten out its behavior.

comment:6 by Jacob, 12 years ago

milestone: 1.3

Milestone 1.3 deleted

Note: See TracTickets for help on using tickets.
Back to Top