aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/command/sdist.py
diff options
context:
space:
mode:
authorPhilip Thiem <ptthiem@gmail.com>2013-06-30 13:13:33 -0500
committerPhilip Thiem <ptthiem@gmail.com>2013-06-30 13:13:33 -0500
commit8d389a37b8237d9dfb3f2b92baf79acda9c5b3f1 (patch)
tree62369cfdccb56fb981581b373cc180956f44e6d8 /setuptools/command/sdist.py
parent82a8940be2ae4f000a95a964b0d945175a0a7cd7 (diff)
downloadexternal_python_setuptools-8d389a37b8237d9dfb3f2b92baf79acda9c5b3f1.tar.gz
external_python_setuptools-8d389a37b8237d9dfb3f2b92baf79acda9c5b3f1.tar.bz2
external_python_setuptools-8d389a37b8237d9dfb3f2b92baf79acda9c5b3f1.zip
Added SVNTextEntries for the moment as a fallback for no SVN/Rev8-10
Added Externals processing for all formats Will use dir-prop[-base] as a fallback otherwise CMD. --HG-- extra : rebase_source : dc27f779f22d5f9795c425b92d34db29d62b495d
Diffstat (limited to 'setuptools/command/sdist.py')
-rwxr-xr-xsetuptools/command/sdist.py45
1 files changed, 5 insertions, 40 deletions
diff --git a/setuptools/command/sdist.py b/setuptools/command/sdist.py
index 39cd6043..e0c4b7e5 100755
--- a/setuptools/command/sdist.py
+++ b/setuptools/command/sdist.py
@@ -4,6 +4,7 @@ from distutils import log
from glob import glob
import os, re, sys, pkg_resources
from glob import glob
+from setuptools.svn_util import SVNEntries
READMES = ('README', 'README.rst', 'README.txt')
@@ -61,49 +62,13 @@ def _default_revctrl(dirname=''):
def externals_finder(dirname, filename):
"""Find any 'svn:externals' directories"""
- found = False
- f = open(filename,'rt')
- for line in iter(f.readline, ''): # can't use direct iter!
- parts = line.split()
- if len(parts)==2:
- kind,length = parts
- data = f.read(int(length))
- if kind=='K' and data=='svn:externals':
- found = True
- elif kind=='V' and found:
- f.close()
- break
- else:
- f.close()
- return
-
- for line in data.splitlines():
- parts = line.split()
- if parts:
- yield joinpath(dirname, parts[0])
-
+ for name in SVNEntries.load(dirname).get_external_dirs(filename):
+ yield joinpath(dirname, name)
-entries_pattern = re.compile(r'name="([^"]+)"(?![^>]+deleted="true")', re.I)
def entries_finder(dirname, filename):
- f = open(filename,'rU')
- data = f.read()
- f.close()
- if data.startswith('<?xml'):
- for match in entries_pattern.finditer(data):
- yield joinpath(dirname,unescape(match.group(1)))
- else:
- svnver=-1
- try: svnver = int(data.splitlines()[0])
- except: pass
- if svnver<8:
- log.warn("unrecognized .svn/entries format in %s", os.path.abspath(dirname))
- return
- for record in map(str.splitlines, data.split('\n\x0c\n')[1:]):
- # subversion 1.6/1.5/1.4
- if not record or len(record)>=6 and record[5]=="delete":
- continue # skip deleted
- yield joinpath(dirname, record[0])
+ for record in SVNEntries.load(dirname).get_undeleted_records():
+ yield joinpath(dirname, record)
finders = [