#17737: collectstatic copies wrong files to STATIC_ROOT
-------------------------------------+------------------------------------
     Reporter:  pigletto             |                    Owner:  jezdez
         Type:  Bug                  |                   Status:  new
    Component:  contrib.staticfiles  |                  Version:  1.3
     Severity:  Normal               |               Resolution:
     Keywords:                       |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+------------------------------------
Changes (by slinkp):

 * cc: slinkp@… (added)


Comment:

 I think I just discovered a different way to trigger the same problem -
 different file being collected on second run.
 What I had was duplicate paths found via different Finders.

 To reproduce w/ Django 1.3.1:

 * Use default value of settings.STATICFILES_FINDERS

 * Put ['appA', 'appB'] in settings.INSTALLED_APPS. Order does not matter.

 * Static files in apps:
   {{{
    appA/
      static/
        file.js   # MORE RECENT

    appB/
      something_else/
        file.js   # OLDER
    }}}
 * settings.STATICFILES_DIRS = [ '/path/to/appB/something_else' ]

 Now, the first time you run, the file.js in appB/something_else will be
 collected first because FileSystemFinder runs first. Then the
 AppDirectoriesFinder will find the one in appA/static, but it's skipped
 because "file.js" is already in self.copied_files.
 So appB wins.

 The second time you run, the file.js in appB/something_else is found first
 again, but skipped because it's not modified.  Then the
 AppDirectoriesFinder runs, and the file.js in appA/static is found, but
 this time "file.js" is not in self.copied_files, and self.delete_file()
 finds that it's more recent than the one we collected on the previous run.
 So appA wins.

 If I understand the original bug report correctly, this variant should be
 fixed on trunk too.

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17737#comment:3>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to