aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/egg_info.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2007-09-26 17:07:52 +0000
committerPJ Eby <distutils-sig@python.org>2007-09-26 17:07:52 +0000
commitdd4feba843d52e18963653b06daeba0c0ad717ed (patch)
tree73f2564fb3b17f70711ed295028a1453094f49e6 /setuptools/command/egg_info.py
parent85ee3531269270d7810ac83487074b4c97215e45 (diff)
downloadexternal_python_setuptools-dd4feba843d52e18963653b06daeba0c0ad717ed.tar.gz
external_python_setuptools-dd4feba843d52e18963653b06daeba0c0ad717ed.tar.bz2
external_python_setuptools-dd4feba843d52e18963653b06daeba0c0ad717ed.zip
Fixed a missing files problem when using Windows source distributions on
non-Windows platforms, due to distutils not handling manifest file line endings correctly. (backport from trunk) --HG-- branch : setuptools-0.6 extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4058259
Diffstat (limited to 'setuptools/command/egg_info.py')
-rwxr-xr-xsetuptools/command/egg_info.py22
1 files changed, 11 insertions, 11 deletions
diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py
index f89dab7c..290f0cdc 100755
--- a/setuptools/command/egg_info.py
+++ b/setuptools/command/egg_info.py
@@ -8,7 +8,6 @@ from setuptools import Command
from distutils.errors import *
from distutils import log
from setuptools.command.sdist import sdist
-from distutils import file_util
from distutils.util import convert_path
from distutils.filelist import FileList
from pkg_resources import parse_requirements, safe_name, parse_version, \
@@ -39,6 +38,7 @@ class egg_info(Command):
+
def initialize_options(self):
self.egg_name = None
self.egg_version = None
@@ -271,6 +271,8 @@ class FileList(FileList):
"""File list that accepts only existing, platform-independent paths"""
def append(self, item):
+ if item.endswith('\r'): # Fix older sdists built on Windows
+ item = item[:-1]
path = convert_path(item)
if os.path.exists(path):
self.files.append(path)
@@ -283,8 +285,6 @@ class FileList(FileList):
-
-
class manifest_maker(sdist):
template = "MANIFEST.in"
@@ -319,7 +319,7 @@ class manifest_maker(sdist):
files = self.filelist.files
if os.sep!='/':
files = [f.replace(os.sep,'/') for f in files]
- self.execute(file_util.write_file, (self.manifest, files),
+ self.execute(write_file, (self.manifest, files),
"writing manifest file '%s'" % self.manifest)
def warn(self, msg): # suppress missing-file warnings from sdist
@@ -347,13 +347,13 @@ class manifest_maker(sdist):
self.filelist.exclude_pattern(sep+r'(RCS|CVS|\.svn)'+sep, is_regex=1)
-
-
-
-
-
-
-
+def write_file (filename, contents):
+ """Create a file with the specified name and write 'contents' (a
+ sequence of strings without line terminators) to it.
+ """
+ f = open(filename, "wb") # always write POSIX-style manifest
+ f.write("\n".join(contents))
+ f.close()