Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/rpms/sugar/sugar-Copy-.xo-to-removable-device-hack.patch
blob: 3bd7e34cbf1a203cd845788d8831a29bd3e063f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
From patchwork Wed Mar 16 12:55:53 2011
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Subject: [sugar] Copy .xo to removable device hack
Date: Wed, 16 Mar 2011 17:55:53 -0000
From: Martin Abente <martin.abente.lahaye@gmail.com>
X-Patchwork-Id: 721
Message-Id: <1300280153-7190-1-git-send-email-martin.abente.lahaye@gmail.com>
To: dextrose@lists.sugarlabs.org, anish@sugarlabs.org, alsroot@sugarlabs.org

Plan Ceibal folks reported that it wasn't possible
to copy .xo files from datastore to removable
devices. This bug affects all versions of dextrose
and other distros based on sugar 0.88.1.

The problem was caused by a too generalist logic
at _check_for_bundle in which the journal was trying
to install bundles also when copying files to
removable devices.

This bug seems to be fixed in mainstream, but as side
effect of a big change to the journal code.

This patch checks for corner cases and avoid any attempt of
installation when copying .xo files to removable devices.

Version 2: Add alsroot suggestions.

Signed-off-by: Martin Abente <martin.abente.lahaye@gmail.com>

---
src/jarabe/journal/journalactivity.py |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/jarabe/journal/journalactivity.py b/src/jarabe/journal/journalactivity.py
index b96135c..916db7c 100644
--- a/src/jarabe/journal/journalactivity.py
+++ b/src/jarabe/journal/journalactivity.py
@@ -277,9 +277,15 @@ class JournalActivity(JournalWindow):
         self._list_view.update_dates()
 
     def _check_for_bundle(self, object_id):
+        # XXX temporary hack, avoid bundle installation
+        # when copying .xo files to removable devices.
+        metadata = model.get(object_id)
+
+        if not model.is_editable(metadata):
+            return
+
         registry = bundleregistry.get_registry()
 
-        metadata = model.get(object_id)
         if metadata.get('progress', '').isdigit():
             if int(metadata['progress']) < 100:
                 return