Skip to content

Commit

Permalink
BUG: only remove an egg when it is installed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ilan Schnell committed Feb 12, 2012
1 parent 3f1e778 commit 2f5fb14
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions egginst/main.py
Expand Up @@ -350,8 +350,9 @@ def get_installed(prefix=sys.prefix):
if not pat.match(fn):
continue
d = read_meta(join(egg_info_dir, fn))
if d:
yield d['egg_name']
if d is None:
continue
yield d['egg_name']


def print_installed(prefix=sys.prefix):
Expand Down
6 changes: 5 additions & 1 deletion enstaller/enpkg.py
Expand Up @@ -176,6 +176,9 @@ def execute_actions(self, actions):
where action is one of 'fetch', 'remote', or 'install' and egg_name
is the filename of the egg.
"""
if self.verbose:
print "execute_actions:", actions

if len(actions) == 0:
return

Expand Down Expand Up @@ -253,7 +256,8 @@ def install_actions(self, arg, mode='recur', force=False, forceall=False):
# remove packages with the same name (from first egg collection
# only, in reverse install order)
for egg in reversed(eggs):
res.append(('remove', egg))
if self.find(egg):
res.append(('remove', egg))
for egg in eggs:
res.append(('install', egg))
return res
Expand Down

0 comments on commit 2f5fb14

Please sign in to comment.