Permalink
Browse files

BUG: only remove an egg when it is installed

  • Loading branch information...
1 parent 3f1e778 commit 2f5fb14b79d6ee2a7c1c7b3c83695a2ebd8be732 Ilan Schnell committed Feb 12, 2012
Showing with 8 additions and 3 deletions.
  1. +3 −2 egginst/main.py
  2. +5 −1 enstaller/enpkg.py
View
@@ -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):
View
@@ -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
@@ -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

0 comments on commit 2f5fb14

Please sign in to comment.