Ticket #2074: 0001-Delete-activities-profile-data-when-uninstall.patch

File 0001-Delete-activities-profile-data-when-uninstall.patch, 1.2 KB (added by tch, 11 years ago)
  • src/sugar/bundle/activitybundle.py

    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 b import locale 
    2525import os
    2626import tempfile
    2727import logging
     28import shutil
    2829
    2930from sugar import env
    3031from sugar import util
    class ActivityBundle(Bundle): 
    417418                       os.readlink(path).startswith(install_path):
    418419                        os.remove(path)
    419420
     421        profile_path = env.get_profile_path(self._bundle_id)
     422        if os.path.exists(profile_path):
     423            shutil.rmtree(profile_path)
     424
    420425        self._uninstall(install_path)
    421426
    422427    def is_user_activity(self):