[gobolinux-devel] Updating the mime database

Jonas Karlsson jonka750 at student.liu.se
Fri Apr 20 12:46:42 UTC 2007


On Fri, 20 Apr 2007 00:22:39 +0200, Hisham Muhammad <hisham.hm at gmail.com>  
wrote:

> On 4/19/07, Jonas Karlsson <jonka750 at student.liu.se> wrote:
>> On Thu, 19 Apr 2007 23:50:26 +0200, Hisham Muhammad  
>> <hisham.hm at gmail.com>
>> wrote:
>>
>> > On 4/19/07, Jonas Karlsson <jonka750 at student.liu.se> wrote:
>> >> After having talked about this with Hisham I agree that we can wait  
>> with
>> >> this, but not because I think this change could wait but because it  
>> has
>> >> to
>> >> be done slightly different. Hisham had an idea (and I agree with him)
>> >> that
>> >> the files should be created in Variables instead. This is done quite
>> >> easy
>> >> by first decide on a hierarchy in Variable, say /S/V/mime, and then
>> >> create
>> >> a symlink /System/Links/Shared/mime/applications ->
>> >> /S/V/mime/applications. Then one can call update-mime-database with
>> >> /S/V/mime as target and all files will be created there. To make this
>> >> work
>> >> with applications that use these files one has to include /S/V/mime  
>> in
>> >> the
>> >> XDG_DATA_DIRS variable, which would be done by appending it to that
>> >> variable from an Environemt file, for example in the Shared-Mime-INFO
>> >> package.
>> >
>> > Is XDG_DATA_DIRS necessary? If there's a symlink in Shared pointing to
>> > Variables, then apps will find the mime data where they usually look
>> > for.
>> >
>> Well, imo that solutions isn't as clean as the one I proposed. I'm
>> guessing you're suggesting a link /S/L/Shared/mime -> /S/Variable/mime.
>> Were would the link for /P/Foo/x.y/Shared/mime/package/foo.xml be  
>> created?
>> SymlinkProgram would try to link it in /S/L/Shared/mime but it would be
>> written in /S/Variable/mime. I'd rather keep the applications links in
>> /S/L and set a path variable instead.
>
> You have a point. Sounds worth testing.
>
Ok, I have tested some and this solution works with Xfce and Thunar at  
least (that's what I have on this system that uses the shared mime  
database). The only change in this diff is that the path in the  
Rebuild_MIME_Database function has changed.
I also attach the new recipe for Shared-Mime-Info, which should enable  
this functionality in the Scripts.

One problem, I just found, is that PostInstall only works with union  
sandbox, so this approach only works out of the box for users of union  
sandbox. And as the PostInstall script is run in a sandbox I have to use  
$variable_target instead of $goboVariable, and hope that those point to  
the same directory (which they should do lately).

-- 
/Jonas

Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: update-mime-database_variable_path.diff
Type: text/x-diff
Size: 6005 bytes
Desc: not available
Url : http://lists.gobolinux.org/pipermail/gobolinux-devel/attachments/20070420/aa21b484/attachment-0002.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Shared-Mime-Info--0.21--recipe.tar.bz2
Type: application/bzip2
Size: 1133 bytes
Desc: not available
Url : http://lists.gobolinux.org/pipermail/gobolinux-devel/attachments/20070420/aa21b484/attachment-0003.bin 


More information about the gobolinux-devel mailing list