aboutsummaryrefslogtreecommitdiffstats
path: root/setuptools/package_index.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-07-10 04:49:31 +0000
committerPJ Eby <distutils-sig@python.org>2005-07-10 04:49:31 +0000
commit451377d0e877fc610d1bdf8181ba70a90e4c14cc (patch)
tree89e0ecc02b8040a747eee92971c0166e63e9e6b2 /setuptools/package_index.py
parent74f597fec6a91b8305177461e7c25bb231999e61 (diff)
downloadexternal_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.tar.gz
external_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.tar.bz2
external_python_setuptools-451377d0e877fc610d1bdf8181ba70a90e4c14cc.zip
Detect and handle conflicts with "unmanaged" packages when installing
packages managed by EasyInstall. Also, add an option to exclude source files from .egg distributions. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4041109
Diffstat (limited to 'setuptools/package_index.py')
-rwxr-xr-xsetuptools/package_index.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/setuptools/package_index.py b/setuptools/package_index.py
index 0a8ccddc..21d37cf9 100755
--- a/setuptools/package_index.py
+++ b/setuptools/package_index.py
@@ -3,6 +3,7 @@
import sys, os.path, re, urlparse, urllib2
from pkg_resources import *
from distutils import log
+from distutils.errors import DistutilsError
HREF = re.compile(r"""href\s*=\s*['"]?([^'"> ]+)""", re.I)
URL_SCHEME = re.compile('([-+.a-z0-9]{2,}):',re.I).match
@@ -38,7 +39,6 @@ def parse_bdist_wininst(name):
-
def distros_for_url(url, metadata=None):
"""Yield egg or source distribution objects that might be found at a URL"""
@@ -272,7 +272,7 @@ class PackageIndex(AvailableDistributions):
try:
spec = Requirement.parse(spec)
except ValueError:
- raise RuntimeError(
+ raise DistutilsError(
"Not a URL, existing file, or requirement spec: %r" %
(spec,)
)
@@ -336,7 +336,7 @@ class PackageIndex(AvailableDistributions):
try:
fp = self.open_url(url)
if isinstance(fp, urllib2.HTTPError):
- raise RuntimeError(
+ raise DistutilsError(
"Can't download %s: %s %s" % (url, fp.code,fp.msg)
)
@@ -373,7 +373,7 @@ class PackageIndex(AvailableDistributions):
except urllib2.HTTPError, v:
return v
except urllib2.URLError, v:
- raise RuntimeError("Download error: %s" % v.reason)
+ raise DistutilsError("Download error: %s" % v.reason)
def _download_url(self, scheme, url, tmpdir):
@@ -432,7 +432,7 @@ class PackageIndex(AvailableDistributions):
return self._download_sourceforge(url, page, tmpdir)
break # not an index page
file.close()
- raise RuntimeError("Unexpected HTML page found at "+url)
+ raise DistutilsError("Unexpected HTML page found at "+url)
def _download_svn(self, url, filename):
@@ -457,7 +457,7 @@ class PackageIndex(AvailableDistributions):
mirror_regex = re.compile(r'HREF=(/.*?\?use_mirror=[^>]*)')
urls = [m.group(1) for m in mirror_regex.finditer(sf_page)]
if not urls:
- raise RuntimeError(
+ raise DistutilsError(
"URL looks like a Sourceforge mirror page, but no URLs found"
)
@@ -481,7 +481,7 @@ class PackageIndex(AvailableDistributions):
scheme = URL_SCHEME(download_url)
return self._download_url(scheme.group(1), download_url, tmpdir)
else:
- raise RuntimeError(
+ raise DistutilsError(
'No META HTTP-EQUIV="refresh" found in Sourceforge page at %s'
% url
)