Ticket #2262 (closed defect: fixed)

Opened 3 years ago

Last modified 2 years ago

bundlebuilder doesn't install mimetypes.xml

Reported by: sascha_silbe Owned by: erikos
Priority: Unspecified by Maintainer Milestone: 0.90
Component: sugar-toolkit Version: 0.84.x
Severity: Blocker Keywords:
Cc: sridhar Distribution/OS:
Bug Status: New

Description

sugar.activity.bundlebuilder.Installer doesn't install the mimetypes.xml on ./setup.py install. This causes files on external media (where we have to guess the MIME type based on the file extension) not to be associated with the activity.
In the case of Restore (an activity to read back Journal backups in Multi-JEB format) this prevents the activity from working at all, thus setting severity to Blocker.
The workaround is to make an XO bundle (using dist_xo) and install it manually (from the Journal).

Change History

Changed 3 years ago by garycmartin

This may also cause problems for the Journal 'send to friend' feature as each side needs to recognize the objects mime type for it to be of any use once received. I need to remember to test this work flow.

Changed 3 years ago by erikos

  • status changed from new to closed
  • resolution set to duplicate

Duplicate of #970.

Changed 3 years ago by erikos

  • status changed from closed to reopened
  • version changed from Git as of bugdate to 0.84.x
  • resolution duplicate deleted

Actually closing the other one and here is what I commented in the other bug. Setting the version to 0.84 as it is already available there.

The installation should include the mimetype the activities define to $prefix/share/mime/application/. The ActivityBundle.install method is doing this.

This effects activities installed by rpms for example.

Changed 3 years ago by erikos

I created a downstream ticket with reference two easily reproducible issues I am aware of:  http://dev.laptop.org/ticket/10427

In the case of the OLPC images we do just unzip the content of the .xo to the Activities folder in HOME without taking the mimetype into account.

Changed 3 years ago by erikos

As we do create the ActivityBundle in the config of the bundlebuilder we can use the code from the activitybundle as well to install the mime type.

Works fine here.

diff --git a/src/sugar/activity/bundlebuilder.py b/src/sugar/activity/bundlebuilder.py
index fc8ebc8..dd7c849 100644
--- a/src/sugar/activity/bundlebuilder.py
+++ b/src/sugar/activity/bundlebuilder.py
@@ -274,6 +274,8 @@ class Installer(object):
 
             shutil.copy(source, dest)
 
+        self.config.bundle.install_mime_type(self.config.source_dir)
+
 
 def cmd_dev(config, args):
     '''Setup for development'''

Changed 2 years ago by sridhar

  • cc sridhar added

Changed 2 years ago by RafaelOrtiz

this could be affecting sacha's backup/restore at least for sugar < 0.90
0

Note: See TracTickets for help on using tickets.