From d22b52434bc37d8f921a4f5de8018bc9962a1105 Mon Sep 17 00:00:00 2001 From: Tomeu Vizoso Date: Sun, 1 Mar 2009 18:24:12 +0100 Subject: [PATCH] Don't recursively clean an activity if it's a symbolic link #444 --- src/sugar/bundle/activitybundle.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py index 7050456d..268576e1 100644 --- a/src/sugar/bundle/activitybundle.py +++ b/src/sugar/bundle/activitybundle.py @@ -350,6 +350,12 @@ class ActivityBundle(Bundle): return install_path def uninstall(self, install_path, force=False): + if os.path.islink(install_path): + # Don't remove the actual activity dir if it's a symbolic link + # because we may be removing user data. + os.unlink(install_path) + return + xdg_data_home = os.getenv('XDG_DATA_HOME', os.path.expanduser('~/.local/share'))