[haiku-bugs] Re: [Haiku] #10435: Problems updating type information for app binaries if a corresponding package exists

  • From: "bonefish" <trac@xxxxxxxxxxxx>
  • Date: Sun, 19 Jan 2014 11:52:03 -0000

#10435: Problems updating type information for app binaries if a corresponding
package exists
---------------------------------+----------------------------
   Reporter:  anevilyak          |      Owner:  bonefish
       Type:  bug                |     Status:  new
   Priority:  normal             |  Milestone:  R1
  Component:  Servers/registrar  |    Version:  R1/Development
 Resolution:                     |   Keywords:
 Blocked By:                     |   Blocking:
Has a Patch:  0                  |   Platform:  All
---------------------------------+----------------------------

Comment (by bonefish):

 Mmh, there seem to be a few questions/problems. First of all, if not
 invoked with "-a" or "-A", should `mimeset` touch the MIME DB at all? It
 doesn't seem right. Not sure what BeOS, though.

 Assuming we don't want that, `update_mime_info()` and consequently
 `MimeInfoUpdater` shouldn't do it either. I'm not even sure that it was
 implemented intentionally the way it works now. It's just that
 `MimeInfoUpdater::Do()` uses `BAppFileInfo::SetSupportedTypes()`, which,
 somewhat surprisingly, also updates the MIME DB entry. Most of its methods
 don't. In fact only `SetIconForType()` also does that. As it is now, the
 functionality also doesn't work correctly when using `mimeset` with a
 custom MIME DB, since it always uses the system MIME DB.

 I think private functionality should be added to `BAppFileInfo` to support
 a custom MIME DB and optionally avoid writing to it.

 That being said, the behavior of `DatabaseLocation::DeleteAttribute()` is
 incorrect. It just uses `_OpenType()`, but it actually needs a writable
 type. `OpenOrCreateType()` would be more appropriate, but not quite, since
 actually we don't want to create a type when it doesn't exist yet.
 Renaming the method to (or adding a new) `OpenWritableType()` with an
 additional "bool create" parameter would be the best solution.

 Finally there's the general question what is supposed to happen when an
 application is installed/available multiple times, as there can only be
 one MIME DB entry for the signature. Having `mimeset` only manipulate the
 MIME DB when "-a" or "-A" is specified makes a lot of sense in that light.

--
Ticket URL: <http://dev.haiku-os.org/ticket/10435#comment:1>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: