Commits

tarek  committed 000950f

better marker for easy_install detection

  • Participants
  • Parent commits 8ae2dde
  • Branches 0.6-maintenance

Comments (0)

Files changed (2)

File distribute_setup.py

 import subprocess
 
 IS_JYTHON = sys.platform.startswith('java')
-DEFAULT_VERSION = "0.6.2"
+DEFAULT_VERSION = "0.6.1"
 DEFAULT_URL     = "http://pypi.python.org/packages/source/d/distribute/"
 
 def quote(c):
         log.warn('Now working in %s' % subdir)
 
         # installing
-        assert python_cmd('setup.py -q install')
+        log.warn('Installing Distribute')
+        assert python_cmd('setup.py install')
     finally:
         os.chdir(old_wd)
 
         log.warn('Now working in %s' % subdir)
 
         # building an egg
-        python_cmd('setup.py -v -q bdist_egg --dist-dir %s' % to_dir)
+        log.warn('Building a Distribute egg in %s' % to_dir)
+        python_cmd('setup.py -q bdist_egg --dist-dir %s' % to_dir)
 
         # returning the result
         for file in os.listdir(to_dir):
 
 # if we are installing Distribute using "python setup.py install"
 # we need to get setuptools out of the way
+def _easy_install_marker():
+    return (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and
+            sys.argv[3] == '--dist-dir' and 'egg-dist-tmp-' in sys.argv[-1])
+
 def _being_installed():
     # easy_install marker
-    if (len(sys.argv) == 5 and sys.argv[2] == 'bdist_egg' and
-            sys.argv[3] == '--dist-dir'):
-        return True
-    return 'install' in sys.argv[1:]
+    return 'install' in sys.argv[1:] or _easy_install_marker()
 
 if _being_installed():
     from distribute_setup import before_install