distribute /

The branch '0.6-maintenance' does not exist.
Diff from to

 This file can also be run as a script to install or upgrade setuptools.
+from site import USER_SITE
 import sys
 import os
 import shutil
         log.warn('Already patched.')
         return False
-    os.rename(path, path +'.OLD.%s' % time.time())
+    _rename_path(path)
     f = open(path, 'w')
 def _rename_path(path):
     new_name = path + '.OLD.%s' % time.time()
     log.warn('Renaming %s into %s' % (path, new_name))
+    try:
+        from setuptools.sandbox import DirectorySandbox
+        def _violation(*args):
+            pass
+        DirectorySandbox._violation = _violation
+    except ImportError:
+        pass
     os.rename(path, new_name)
     return new_name
 def _under_prefix(location):
+    if 'install' not in sys.argv:
+        return True
     args = sys.argv[sys.argv.index('install')+1:]
     for index, arg in enumerate(args):
         for option in ('--root', '--prefix'):
             if arg.startswith('%s=' % option):
                 if len(args) > index:
                     top_dir = args[index+1]
                     return location.startswith(top_dir)
+            elif option == '--user':
+                return location.startswith(USER_SITE)
     return True
 def fake_setuptools():