summaryrefslogtreecommitdiff
path: root/easy_install.py
diff options
context:
space:
mode:
authorPJ Eby <distutils-sig@python.org>2005-05-29 06:41:14 +0000
committerPJ Eby <distutils-sig@python.org>2005-05-29 06:41:14 +0000
commitaeb8585bd48ea399347e58da37b03b871ae92232 (patch)
treed5d769be1ba717207f8c6518a0e7e92f154cfe9e /easy_install.py
parent8bd6873618f5e219f8c859d0a302eed8eabe99eb (diff)
downloadpython-setuptools-bitbucket-aeb8585bd48ea399347e58da37b03b871ae92232.tar.gz
Oddly enough, some setup.py files actually check __name__=='__main__'
Diffstat (limited to 'easy_install.py')
-rwxr-xr-xeasy_install.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/easy_install.py b/easy_install.py
index 0ca094b2..36482fe4 100755
--- a/easy_install.py
+++ b/easy_install.py
@@ -184,7 +184,7 @@ class Installer:
)
elif multi is None:
multi = True
-
+
elif not multi:
# explicit false, raise an error
raise RuntimeError(
@@ -337,7 +337,9 @@ class Installer:
try:
sys.argv[:] = [setup_script, '-q', 'bdist_egg']
sys.path.insert(0,os.getcwd())
- execfile(setup_script, {'__file__':setup_script})
+ execfile(setup_script,
+ {'__file__':setup_script, '__name__':'__main__'}
+ )
except SystemExit, v:
if v.args and v.args[0]:
raise RuntimeError(
@@ -365,8 +367,6 @@ class Installer:
-
-
def install_egg(self, egg_path, zip_ok):
import shutil
destination = os.path.join(self.instdir, os.path.basename(egg_path))
@@ -383,10 +383,10 @@ class Installer:
shutil.move(egg_path, destination)
else:
shutil.copy2(egg_path, destination)
-
+
elif os.path.isdir(egg_path):
shutil.move(egg_path, destination)
-
+
else:
os.mkdir(destination)
self._extract_zip(egg_path, destination)
@@ -502,7 +502,7 @@ def main(argv):
parser.add_option("-z", "--zip",
action="store_true", dest="zip_ok", default=False,
help="install package as a zipfile")
-
+
parser.add_option("-m", "--multi-version",
action="store_true", dest="multi", default=None,
help="make apps have to require() a version")
@@ -512,7 +512,7 @@ def main(argv):
try:
if not args:
raise RuntimeError("No urls, filenames, or requirements specified")
-
+
for spec in args:
inst = Installer(options.instdir, options.zip_ok, options.multi)
try: