Fixed #14998 -- Made use of os.path.join to make sure this works on all platforms. Thanks for the pointer, CarlFK.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@15128 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
e45d1e2dac
commit
be56f74f93
|
@ -100,7 +100,7 @@ Type 'yes' to continue, or 'no' to cancel: """)
|
||||||
except (OSError, NotImplementedError):
|
except (OSError, NotImplementedError):
|
||||||
source_last_modified = None
|
source_last_modified = None
|
||||||
if prefix:
|
if prefix:
|
||||||
destination = '/'.join([prefix, source])
|
destination = os.path.join(prefix, source)
|
||||||
else:
|
else:
|
||||||
destination = source
|
destination = source
|
||||||
symlink = options['link']
|
symlink = options['link']
|
||||||
|
|
|
@ -82,6 +82,6 @@ class AppStaticStorage(FileSystemStorage):
|
||||||
prefix = self.get_prefix()
|
prefix = self.get_prefix()
|
||||||
for path in utils.get_files(self, ignore_patterns):
|
for path in utils.get_files(self, ignore_patterns):
|
||||||
if prefix:
|
if prefix:
|
||||||
path = '/'.join([prefix, path])
|
path = os.path.join(prefix, path)
|
||||||
files.append(path)
|
files.append(path)
|
||||||
return files
|
return files
|
||||||
|
|
|
@ -1,18 +1,17 @@
|
||||||
|
import os
|
||||||
import fnmatch
|
import fnmatch
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.exceptions import ImproperlyConfigured
|
from django.core.exceptions import ImproperlyConfigured
|
||||||
|
|
||||||
def get_files(storage, ignore_patterns=[], location=''):
|
def get_files(storage, ignore_patterns=[], location=''):
|
||||||
"""
|
"""
|
||||||
Recursively walk the storage directories gathering a complete list of files
|
Recursively walk the storage directories gathering a complete
|
||||||
that should be copied, returning this list.
|
list of files that should be copied, returning this list.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
def is_ignored(path):
|
def is_ignored(path):
|
||||||
"""
|
"""
|
||||||
Return True or False depending on whether the ``path`` should be
|
Return True or False depending on whether the ``path`` should be
|
||||||
ignored (if it matches any pattern in ``ignore_patterns``).
|
ignored (if it matches any pattern in ``ignore_patterns``).
|
||||||
|
|
||||||
"""
|
"""
|
||||||
for pattern in ignore_patterns:
|
for pattern in ignore_patterns:
|
||||||
if fnmatch.fnmatchcase(path, pattern):
|
if fnmatch.fnmatchcase(path, pattern):
|
||||||
|
@ -20,14 +19,14 @@ def get_files(storage, ignore_patterns=[], location=''):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
directories, files = storage.listdir(location)
|
directories, files = storage.listdir(location)
|
||||||
static_files = [location and '/'.join([location, fn]) or fn
|
static_files = [location and os.path.join(location, fn) or fn
|
||||||
for fn in files
|
for fn in files
|
||||||
if not is_ignored(fn)]
|
if not is_ignored(fn)]
|
||||||
for dir in directories:
|
for dir in directories:
|
||||||
if is_ignored(dir):
|
if is_ignored(dir):
|
||||||
continue
|
continue
|
||||||
if location:
|
if location:
|
||||||
dir = '/'.join([location, dir])
|
dir = os.path.join(location, dir)
|
||||||
static_files.extend(get_files(storage, ignore_patterns, dir))
|
static_files.extend(get_files(storage, ignore_patterns, dir))
|
||||||
return static_files
|
return static_files
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue