diff options
author | PJ Eby <distutils-sig@python.org> | 2007-07-11 17:37:17 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2007-07-11 17:37:17 +0000 |
commit | 74aaaf1c55d624b3424a435928b4ab310784a57c (patch) | |
tree | 954e5d75c76b33e632851ce4963704bd491db6be /setuptools | |
parent | 29c54edeca3c017eae443dd2b4282a84cf037f06 (diff) | |
download | external_python_setuptools-74aaaf1c55d624b3424a435928b4ab310784a57c.tar.gz external_python_setuptools-74aaaf1c55d624b3424a435928b4ab310784a57c.tar.bz2 external_python_setuptools-74aaaf1c55d624b3424a435928b4ab310784a57c.zip |
Fix distutils.filelist.findall() crashing on broken symlinks. Fix
egg_info failures on new, uncommitted SVN directories.
--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4056277
Diffstat (limited to 'setuptools')
-rw-r--r-- | setuptools/__init__.py | 26 | ||||
-rwxr-xr-x | setuptools/command/egg_info.py | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/setuptools/__init__.py b/setuptools/__init__.py index cdf8eae2..a4f84445 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -63,19 +63,19 @@ class Command(_Command): import distutils.core distutils.core.Command = Command # we can't patch distutils.cmd, alas - - - - - - - - - - - - - +def findall(dir = os.curdir): + """Find all files under 'dir' and return the list of full filenames + (relative to 'dir'). + """ + all_files = [] + for base, dirs, files in os.walk(dir): + if base!=os.curdir: + files = [os.path.join(base, f) for f in files] + all_files.extend(filter(os.path.isfile, files)) + return all_files + +import distutils.filelist +distutils.filelist.findall = findall # fix findall bug in distutils. diff --git a/setuptools/command/egg_info.py b/setuptools/command/egg_info.py index eae7312e..f89dab7c 100755 --- a/setuptools/command/egg_info.py +++ b/setuptools/command/egg_info.py @@ -221,10 +221,10 @@ class egg_info(Command): data = map(str.splitlines,data.split('\n\x0c\n')) del data[0][0] # get rid of the '8' dirurl = data[0][3] - localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]) + localrev = max([int(d[9]) for d in data if len(d)>9 and d[9]]+[0]) elif data.startswith('<?xml'): dirurl = urlre.search(data).group(1) # get repository URL - localrev = max([int(m.group(1)) for m in revre.finditer(data)]) + localrev = max([int(m.group(1)) for m in revre.finditer(data)]+[0]) else: log.warn("unrecognized .svn/entries format; skipping %s", base) dirs[:] = [] |