Debian Codegraph @

debian/patches/set-default-menu.patch

raw
1 From: Ryan Kavanagh <[email protected]>
2 Date: Thu, 8 Oct 2015 13:34:16 -0700
3 Subject: Set default menu to be parsed
4
5 Upstream defaults to applications.menu, which isn't provided by Debian. We'll
6 try upstream's default, falling back to debian-menu.menu if it doesn't exist.
7
8 Origin: vendor
9 Bug-Debian: http://bugs.debian.org/654978
10 Forwarded: no
11 Last-Update: 2012-03-09
12 ---
13 xdg/Menu.py | 9 +++++++++
14 1 file changed, 9 insertions(+)
15
16 diff --git a/xdg/Menu.py b/xdg/Menu.py
17 index 1dd2af5..1ec9e28 100644
18 --- a/xdg/Menu.py
19 +++ b/xdg/Menu.py
20 @@ -623,8 +623,17 @@ class XMLMenuBuilder(object):
21 filename = _get_menu_file_path(filename)
22 # use default if no filename given
23 if not filename:
24 + # Upstream's default, we leave it as default in case someone
25 + # produces their own applications.menu and is depending on it.
26 candidate = os.environ.get('XDG_MENU_PREFIX', '') + "applications.menu"
27 filename = _get_menu_file_path(candidate)
28 + # Since applications.menu isn't provided in Debian, we'll fallback
29 + # to debian.menu, typically in /etc/xdg/menus/debian-menu.menu
30 + # (Closes: #654978)
31 + if not filename:
32 + candidate = os.environ.get('XDG_MENU_PREFIX', '') + \
33 + "debian-menu.menu"
34 + filename = _get_menu_file_path(candidate)
35 if not filename:
36 raise ParsingError('File not found', "/etc/xdg/menus/%s" % candidate)
37 # check if it is a .menu file