Commit ddfd78c6 authored by PJ Eby's avatar PJ Eby

Fix a problem installing eggs with a system packaging tool if the project

contained an implicit namespace package; for example if the ``setup()``
listed a namespace package ``foo.bar`` without explicitly listing
``foo`` as a namespace package. (backport from trunk)

--HG--
branch : setuptools-0.6
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/branches/setuptools-0.6%4053271
parent 5e2fb1dc
......@@ -2623,6 +2623,11 @@ Release Notes/Change History
``develop`` and the source directory is a subdirectory of the installation
target directory.
* Fix a problem installing eggs with a system packaging tool if the project
contained an implicit namespace package; for example if the ``setup()``
listed a namespace package ``foo.bar`` without explicitly listing ``foo``
as a namespace package.
0.6c3
* Fixed breakages caused by Subversion 1.4's new "working copy" format
......
......@@ -22,7 +22,7 @@ class install_egg_info(Command):
None, None, ei_cmd.egg_name, ei_cmd.egg_version
).egg_name()+'.egg-info'
self.source = ei_cmd.egg_info
self.target = os.path.join(self.install_dir, basename)
self.target = os.path.join(self.install_dir, basename)
self.outputs = [self.target]
def run(self):
......@@ -43,7 +43,7 @@ class install_egg_info(Command):
return self.outputs
def copytree(self):
# Copy the .egg-info tree to site-packages
# Copy the .egg-info tree to site-packages
def skimmer(src,dst):
# filter out source-control directories; note that 'src' is always
# a '/'-separated path, regardless of platform. 'dst' is a
......@@ -57,9 +57,8 @@ class install_egg_info(Command):
unpack_archive(self.source, self.target, skimmer)
def install_namespaces(self):
nsp = (self.distribution.namespace_packages or [])[:]
nsp = self._get_all_ns_packages()
if not nsp: return
nsp.sort() # set up shorter names first
filename,ext = os.path.splitext(self.target)
filename += '-nspkg.pth'; self.outputs.append(filename)
log.info("Installing %s",filename)
......@@ -78,5 +77,47 @@ class install_egg_info(Command):
"(p not in mp) and mp.append(p)\n"
% locals()
)
f.close()
f.close()
def _get_all_ns_packages(self):
nsp = {}
for pkg in self.distribution.namespace_packages or []:
pkg = pkg.split('.')
while pkg:
nsp['.'.join(pkg)] = 1
pkg.pop()
nsp=list(nsp)
nsp.sort() # set up shorter names first
return nsp
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment