diff options
author | PJ Eby <distutils-sig@python.org> | 2005-08-23 13:24:42 +0000 |
---|---|---|
committer | PJ Eby <distutils-sig@python.org> | 2005-08-23 13:24:42 +0000 |
commit | b2382a4ed6703da09393343974c87ce0f4ce6670 (patch) | |
tree | d3b01794e20a207e35d4ae8f079d02f3b7786b75 /setuptools/command | |
parent | b577c94170b64436919bea8e002c64623d0a9644 (diff) | |
download | external_python_setuptools-b2382a4ed6703da09393343974c87ce0f4ce6670.tar.gz external_python_setuptools-b2382a4ed6703da09393343974c87ce0f4ce6670.tar.bz2 external_python_setuptools-b2382a4ed6703da09393343974c87ce0f4ce6670.zip |
Simplify non-root install process and improve Mac OS docs for it. Support
.pth files and legacy packages possibly being symlinks, and ensure that
overwrites don't follow the symlink.
--HG--
branch : setuptools
extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041229
Diffstat (limited to 'setuptools/command')
-rw-r--r-- | setuptools/command/bdist_egg.py | 6 | ||||
-rwxr-xr-x | setuptools/command/easy_install.py | 22 |
2 files changed, 12 insertions, 16 deletions
diff --git a/setuptools/command/bdist_egg.py b/setuptools/command/bdist_egg.py index 1f17bb82..0c5fae43 100644 --- a/setuptools/command/bdist_egg.py +++ b/setuptools/command/bdist_egg.py @@ -168,14 +168,11 @@ class bdist_egg(Command): # We run install_lib before install_data, because some data hacks # pull their data path from the install_lib command. - log.info("installing library code to %s" % self.bdist_dir) instcmd = self.get_finalized_command('install') - old_root = instcmd.root - instcmd.root = None + old_root = instcmd.root; instcmd.root = None cmd = self.call_command('install_lib', warn_dir=0) instcmd.root = old_root - ext_outputs = cmd._mutate_outputs( self.distribution.has_ext_modules(), 'build_ext', 'build_lib', '' ) @@ -201,7 +198,6 @@ class bdist_egg(Command): archive_root = self.bdist_dir egg_info = os.path.join(archive_root,'EGG-INFO') self.mkpath(egg_info) - if self.distribution.scripts: script_dir = os.path.join(egg_info, 'scripts') log.info("installing scripts to %s" % script_dir) diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 3f754af6..db865e80 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -104,8 +104,10 @@ class easy_install(Command): for filename in blockers: log.info("Deleting %s", filename) if not self.dry_run: - if os.path.isdir(filename): - shutil.rmtree(filename) + if hasattr(os.path,'islink') and os.path.islink(filename): + os.unlink(filename) + elif os.path.isdir(filename): + shutil.rmtree(filename) else: os.unlink(filename) @@ -119,8 +121,6 @@ class easy_install(Command): - - def finalize_options(self): # If a non-default installation directory was specified, default the # script directory to match it. @@ -846,7 +846,9 @@ See the setuptools documentation for the "develop" command for more info. if dist.key=='setuptools': # Ensure that setuptools itself never becomes unavailable! # XXX should this check for latest version? - f = open(os.path.join(self.install_dir,'setuptools.pth'), 'wt') + filename = os.path.join(self.install_dir,'setuptools.pth') + unlink_if_symlink(filename) + f = open(filename, 'wt') f.write(dist.location+'\n') f.close() @@ -857,8 +859,6 @@ See the setuptools documentation for the "develop" command for more info. return dst # only unpack-and-compile skips files for dry run - - def unpack_and_compile(self, egg_path, destination): to_compile = [] @@ -1017,9 +1017,9 @@ def extract_wininst_cfg(dist_filename): f.close() - - - +def unlink_if_symlink(filename): + if hasattr(os.path,'islink') and os.path.islink(filename): + os.unlink(filename) @@ -1100,11 +1100,11 @@ class PthDistributions(Environment): if self.dirty: log.debug("Saving %s", self.filename) data = '\n'.join(self.paths+['']) + unlink_if_symlink(self.filename) f = open(self.filename,'wt'); f.write(data); f.close() self.dirty = False - def add(self,dist): """Add `dist` to the distribution map""" if dist.location not in self.paths: |