Bug 25702

Summary: extra groups in desktop files are not handled properly
Product: Sisyphus Reporter: Sergey Vlasov <vsu>
Component: menuAssignee: Sergey V Turchin <zerg>
Status: CLOSED FIXED QA Contact: qa-sisyphus
Severity: normal    
Priority: P3 CC: viy, zerg
Version: unstable   
Hardware: all   
OS: Linux   

Description Sergey Vlasov 2011-06-01 21:02:41 MSK
menu-2.1.41-alt19

В deadbeef-0.5.1-alt1 в файле /usr/share/applications/deadbeef.desktop, помимо стандартной группы [Desktop Entry], появились дополнительные группы:

===============================================================
[Play Shortcut Group]
Name=Play
Exec=deadbeef --play
TargetEnvironment=Unity

[Pause Shortcut Group]
Name=Pause
Exec=deadbeef --pause
TargetEnvironment=Unity

[Stop Shortcut Group]
Name=Stop
Exec=deadbeef --stop
TargetEnvironment=Unity

[Next Shortcut Group]
Name=Next
Exec=deadbeef --next
TargetEnvironment=Unity

[Prev Shortcut Group]
Name=Prev
Exec=deadbeef --prev
TargetEnvironment=Unity
===============================================================

Однако update-menus обрабатывает этот файл неправильно - вместо того, чтобы брать значения Name и Exec из группы [Desktop Entry], берутся последние встреченные строки в файле без учёта группы, в результате в меню вместо пункта "DeaDBeeF" появляется "Prev", запускающий "deadbeef --prev".

Спецификация формата desktop-файлов допускает наличие дополнительных групп после [Desktop Entry]:

The basic format of the desktop entry file requires that there be a group header named Desktop Entry. There may be other groups present in the file, but this is the most important group which explicitly needs to be supported. This group should also be used as the "magic key" for automatic MIME type detection. There should be nothing preceding this group in the desktop entry file but possibly one or more comments.

Т.е., в desktop-файле могут быть любые группы, необходимо лишь, чтобы группа [Desktop Entry] была размещена в начале файла.
Comment 1 Repository Robot 2011-06-01 22:23:15 MSK
menu-2.1.41-alt20 -> sisyphus:

* Wed Jun 01 2011 Igor Vlasenko <viy@altlinux> 2.1.41-alt20
- bugfix: handle extra groups in desktop files (ALT#25702)