From 823188957cc4aab7ef566cecd0f107c4695de429 Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Sun, 20 Sep 2009 13:40:24 +0000 Subject: [PATCH] Treat broken symlinks corretcly #1394 --- src/sugar/bundle/activitybundle.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index 95fc4dda..a1f10b9f 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -371,12 +371,12 @@ class ActivityBundle(Bundle): def _symlink(self, src, dst): if not os.path.isfile(src): return - if os.path.exists(dst) and not os.path.islink(dst): + if not os.path.islink(dst) and os.path.exists(dst): raise RuntimeError('Do not remove %s if it was not ' 'installed by sugar', dst) logging.debug('Link resource %s to %s', src, dst) - if os.path.exists(dst): - logging.debug('Rewrite %s', dst) + if os.path.lexists(dst): + logging.debug('Relink %s', dst) os.unlink(dst) os.symlink(src, dst)