From 72930bc0b1cb2e4e193c977802e92c86f72fdd7e Mon Sep 17 00:00:00 2001 From: PJ Eby Date: Sat, 11 Mar 2006 00:39:09 +0000 Subject: 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 --- site.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'site.py') 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': + + + -- cgit v1.2.1