aboutsummaryrefslogtreecommitdiffstats
path: root/site.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2006-03-11 00:39:09 +0000
committerPJ Eby <distutils-sig@python.org>2006-03-11 00:39:09 +0000
commit72930bc0b1cb2e4e193c977802e92c86f72fdd7e (patch)
treeac67feea622995c06a21fed7fd73d45be413383a /site.py
parentd2416feac24edccc11352f436c2a6ca3b5552384 (diff)
downloadexternal_python_setuptools-72930bc0b1cb2e4e193c977802e92c86f72fdd7e.tar.gz
external_python_setuptools-72930bc0b1cb2e4e193c977802e92c86f72fdd7e.tar.bz2
external_python_setuptools-72930bc0b1cb2e4e193c977802e92c86f72fdd7e.zip
Added automatic handling of installation conflicts. Eggs are now shifted to
the front of sys.path, in an order consistent with where they came from, making EasyInstall seamlessly co-operate with system package managers. The ``--delete-conflicting`` and ``--ignore-conflicts-at-my-risk`` options are now no longer necessary, and will generate warnings at the end of a run if you use them. --HG-- branch : setuptools extra : convert_revision : svn%3A6015fed2-1504-0410-9fe1-9d1591cc4771/sandbox/trunk/setuptools%4042965
Diffstat (limited to 'site.py')
-rwxr-xr-xsite.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/site.py b/site.py
index 2e229842..80e084b2 100755
--- a/site.py
+++ b/site.py
@@ -41,12 +41,16 @@ def __boot():
known_paths = dict([(makepath(item)[1],1) for item in sys.path]) # 2.2 comp
+ oldpos = getattr(sys,'__egginsert',0) # save old insertion position
+ sys.__egginsert = 0 # and reset the current one
+
for item in PYTHONPATH:
addsitedir(item)
+
+ sys.__egginsert += oldpos # restore effective old position
d,nd = makepath(stdpath[0])
insert_at = None
- skipped = []
new_path = []
for item in sys.path:
@@ -54,22 +58,15 @@ def __boot():
if np==nd and insert_at is None:
# We've hit the first 'system' path entry, so added entries go here
- new_path.extend(skipped)
insert_at = len(new_path)
- skipped = []
- if np in known_paths:
- # Old path, just copy
+ if np in known_paths or insert_at is None:
new_path.append(item)
- elif insert_at is None:
- # New path before the insert point, buffer it
- skipped.append(item)
else:
# new path after the insert point, back-insert it
new_path.insert(insert_at, item)
insert_at += 1
- new_path.extend(skipped)
sys.path[:] = new_path
if __name__=='site':
@@ -80,3 +77,6 @@ if __name__=='site':
+
+
+