From ca9ccbf6e73daf553bc41d5abd02f8ebf0d44b45 Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Tue, 7 Feb 2006 16:43:41 +0000 Subject: The ``--always-copy`` option now skips "system" and "development" eggs since they can't be reliably copied. Note that this may cause EasyInstall to choose an older version of a package than what you expected, or it may cause downloading and installation of a fresh version of what's already installed. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4042260 --- setuptools/command/easy_install.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 71fe46bb..31975f63 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -305,27 +305,27 @@ class easy_install(Command): spec = parse_requirement_arg(spec) self.check_editable(spec) - download = self.package_index.fetch( - spec, tmpdir, self.upgrade, self.editable + dist = self.package_index.fetch_distribution( + spec, tmpdir, self.upgrade, self.editable, not self.always_copy ) - if download is None: - raise DistutilsError( - "Could not find distribution for %r" % spec - ) - - return self.install_item(spec, download, tmpdir, deps) + if dist is None: + msg = "Could not find suitable distribution for %r" % spec + if self.always_copy: + msg+=" (--always-copy skips system and development eggs)" + raise DistutilsError(msg) + elif dist.precedence==DEVELOP_DIST: + # .egg-info dists don't need installing, just process deps + self.process_distribution(spec, dist, deps, "Using") + return dist + else: + return self.install_item(spec, dist.location, tmpdir, deps) finally: if os.path.exists(tmpdir): rmtree(tmpdir) - - - - - def install_item(self, spec, download, tmpdir, deps, install_needed=False): # Installation is also needed if file in tmpdir or is not an egg -- cgit v1.2.1