Commit 618312be authored by Jason R. Coombs's avatar Jason R. Coombs

Refactor to short-circuit on dry-run

parent de000c41
...@@ -828,14 +828,16 @@ class easy_install(Command): ...@@ -828,14 +828,16 @@ class easy_install(Command):
target = os.path.join(self.script_dir, script_name) target = os.path.join(self.script_dir, script_name)
self.add_output(target) self.add_output(target)
mask = current_umask()
if not self.dry_run: if not self.dry_run:
ensure_directory(target) return
if os.path.exists(target):
os.unlink(target) mask = current_umask()
with open(target, "w" + mode) as f: ensure_directory(target)
f.write(contents) if os.path.exists(target):
chmod(target, 0o777 - mask) os.unlink(target)
with open(target, "w" + mode) as f:
f.write(contents)
chmod(target, 0o777 - mask)
def install_eggs(self, spec, dist_filename, tmpdir): def install_eggs(self, spec, dist_filename, tmpdir):
# .egg dirs or files are already built, so just return them # .egg dirs or files are already built, so just return them
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment