#35593: collectstatic does not preserve source file timestamps
------------------------+-----------------------------------------------
Reporter: kunkku | Type: Uncategorized
Status: new | Component: contrib.staticfiles
Version: 4.2 | Severity: Normal
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
------------------------+-----------------------------------------------
The `collectstatic` management command interacts badly with Linux package
managers.
When `collectstatic` copies files, the ''last modified'' timestamp of the
destination file gets set to the time when the command was run. If the
destination file already exists and the corresponding source file does not
have a newer timestamp, copying is skipped.
When files are installed by `pip`, the timestamps are set according to the
installation time. However, this may not be the case with other package
managers, such as `rpm` or `dpkg`. With native package mangers, the
timestamps often reflect the build time of the package instead of the
installation time. Therefore, `collectstatic` may skip source files that
were actually updated by the package manager if the source package was
built before the destination file was created.
To ensure correct operation, the destination directory must currently be
emptied if any of the source files comes from the Linux distro. The
suggested solution is to copy the timestamp of the source file to the
destination file instead of using the current time.
--
Ticket URL: <
https://code.djangoproject.com/ticket/35593>
Django <
https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.