From 369df637c8f923600729bb06628a70cc3c4a39f9 Mon Sep 17 00:00:00 2001
From: Martin Abente <mabente@paraguayeduca.org>
Date: Mon, 5 Jul 2010 15:26:51 -0400
Subject: [PATCH] Delete activities profile data when uninstall
Organization: Paraguay Educa

When activities are uninstalled, profile data persists. Profile
data can consume a lot of disk space. Therefore it is necessary
to delete it.

More info http://bugs.sugarlabs.org/ticket/2074
---
 src/sugar/bundle/activitybundle.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/sugar/bundle/activitybundle.py b/src/sugar/bundle/activitybundle.py
index c83257f..51ad312 100644
--- a/src/sugar/bundle/activitybundle.py
+++ b/src/sugar/bundle/activitybundle.py
@@ -25,6 +25,7 @@ import locale
 import os
 import tempfile
 import logging
+import shutil
 
 from sugar import env
 from sugar import util
@@ -417,6 +418,10 @@ class ActivityBundle(Bundle):
                        os.readlink(path).startswith(install_path):
                         os.remove(path)
 
+        profile_path = env.get_profile_path(self._bundle_id)
+        if os.path.exists(profile_path):
+            shutil.rmtree(profile_path)
+
         self._uninstall(install_path)
 
     def is_user_activity(self):
-- 
1.6.0.4

