Commits

Anonymous committed 4a87a91

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

Comments (0)

Files changed (1)

     #"Development Status :: 4 - Beta",
     "Environment :: Web Environment",
     "Intended Audience :: Developers",
-    "License :: Freely Distributable",
+    "License :: Freely Distributable",
     "Operating System :: OS Independent",
     "Programming Language :: Python",
     "Topic :: Internet :: WWW/HTTP :: Dynamic Content",
 cp_license="BSD"
 packages=[
     "cherrypy", "cherrypy.lib",
-    "cherrypy.tutorial", "cherrypy.test",
+    "cherrypy.tutorial", "cherrypy.test",
     "cherrypy.wsgiserver",
 ]
 download_url="http://download.cherrypy.org/cherrypy/3.0.3/"
 # 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: