Do not put update-gnome-menus-cache into $PATH

Bug #540813 reported by Valentijn Sessink
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
gnome-menus (Ubuntu)
Fix Released
Low
Martin Pitt

Bug Description

Binary package hint: gnome-menus

After installing Lucid 10.04-alpha on 2010-03-17 (from a preseeded PXE install), the /usr/share/applications/desktop.nl_NL.utf8.cache file contains many, many English descriptions of the applications - so the Gnome menus are filled with English descriptions. The system language is nl_NL.utf8 (and, in fact, a cache file that has nl_NL.utf8 should *never* get the English descriptions in the menus when there are nl_NL.utf8 descriptions available).

Running the (undocumented) update-gnome-menus-cache in this directory fixes things, but there's a couple of bad practices here:

- the documentation for various packages doesn't tell about update-gnome-menus-cache.
- update-gnome-menus-cache doesn't even have a man page
- For example, trying to add a new screensaver-type by hand does not work when you put a .desktop file in /usr/share/applications/screensavers/. In fact, *deleting* a .desktop file there does not remove the screensaver from the screensaver settings menu!
- a cache file should not reside in /usr/share/applications/
- *if* you cache files, you should make sure the cached file will be rebuilt.

In this case, a wrong desktop.$i18n.cache file will get all menus wrong, and there seems nothing you can do about it.

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thank you for your bug report, the cache update uses a trigger which means it will be updated when any package install a desktop entry in the directory, local changes are supposed to be made in the local directory and not in the distribution one

Changed in gnome-menus (Ubuntu):
importance: Undecided → Low
Revision history for this message
Valentijn Sessink (valentijn) wrote : Re: [Bug 540813] Re: wrong /usr/share/applications/desktop.$locale.cache files

On 23-03-10 12:06, Sebastien Bacher wrote:
> Thank you for your bug report, the cache update uses a trigger which
> means it will be updated when any package install a desktop entry in the
> directory, local changes are supposed to be made in the local directory
> and not in the distribution one

Do you want me to file bugs for the individual problems? I.e. a cache
file not in a cache directory; the nl_NL files containing English
descriptions; the non-documentation for this utility?

V.

Revision history for this message
Martin Pitt (pitti) wrote : Re: wrong /usr/share/applications/desktop.$locale.cache files

> - the documentation for various packages doesn't tell about update-gnome-menus-cache.
> - update-gnome-menus-cache doesn't even have a man page

It's an internal implementation detail. I agree it shouldn't be in /usr/bin, so we can use this bug to track moving it to /usr/share/.

> - For example, trying to add a new screensaver-type by hand does not work when you put a .desktop file in /usr/share/applications /screensavers/. In fact, *deleting* a .desktop file there does not remove the screensaver from the screensaver settings menu!

This is not supported. Please use /usr/local/applications or ~/.local/applications for custom .desktop files. /usr is for distro packages, /usr/local and /home for user customizations.

> - a cache file should not reside in /usr/share/applications/

Indeed it might be nicer in /var/cache; it makes the lookups less efficient, but it should be bearable. This could become a separate wishlist bug.

> - *if* you cache files, you should make sure the cached file will be rebuilt.

That's already done via dpkg triggers.

summary: - wrong /usr/share/applications/desktop.$locale.cache files
+ Do not put update-gnome-menus-cache into $PATH
Changed in gnome-menus (Ubuntu):
status: New → Triaged
Revision history for this message
Valentijn Sessink (valentijn) wrote :

Martin, there's just one element of the bug left, namely the /usr/share/applications/desktop.nl_NL.utf8.cache containing English descriptions. As far as I can see, this is probably the result of update-gnome-menus-cache setting it's locale with locale.setlocale(locale.LC_ALL, ''), while the output file is probably generated with another mechanism - unknown to me.

During preseeded installation, these seem to differ, and the menus end up being in English.

Do you want me to open a different bug for this?

Revision history for this message
Martin Pitt (pitti) wrote :

Valentijn,

this sounds related to bug 517616, but if you still get it on lucid beta-1 (after sudo update-gnome-menus-cache), then yes, please file a new bug and assign it to "pitti". Thanks!

Martin Pitt (pitti)
Changed in gnome-menus (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Martin Pitt (pitti)
Martin Pitt (pitti)
Changed in gnome-menus (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package gnome-menus - 2.29.92-0ubuntu5

---------------
gnome-menus (2.29.92-0ubuntu5) lucid; urgency=low

  * debian/update-gnome-menus-cache: Fix crash on invalid UTF-8 in
    translations, fall back to untranslated string. (LP: #531412)
  * debian/python-gmenu.postinst, debian/rules: Install
    update-gnome-menus-cache into /usr/share/gnome-menus instead of /usr/bin.
    It's a private implementation detail, not something that users should
    run/see. (LP: #540813)
  * debian/update-gnome-menus-cache: Ignore other exceptions during
    translation as well (such as IndexError), and fall back to untranslated
    string instead of crashing. (LP: #504785)
 -- Martin Pitt <email address hidden> Thu, 25 Mar 2010 15:49:40 +0100

Changed in gnome-menus (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.