Anonymous avatar Anonymous committed a1fbbbb

backport of r2225 from trunk (fixes #882 - data files incorrectly placed in windows binary distro)

Comments (0)

Files changed (1)

 # end arguments for setup
 ###############################################################################
 
+def fix_data_files(data_files):
+    """
+    bdist_wininst seems to have a bug about where it installs data files.
+    I found a fix the django team used to work around the problem at
+    http://code.djangoproject.com/changeset/8313 .  This function
+    re-implements that solution.
+    Also see http://mail.python.org/pipermail/distutils-sig/2004-August/004134.html
+    for more info.
+    """
+    def fix_dest_path(path):
+        return '\\PURELIB\\%(path)s' % vars()
+    
+    if not 'bdist_wininst' in sys.argv: return
+    
+    data_files[:] = [
+        (fix_dest_path(path), files)
+        for path, files in data_files]
+fix_data_files(data_files)
 
 def main():
     if sys.version < required_python_version:
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.