diff options
author | Zac Medico <zmedico@gentoo.org> | 2012-09-02 12:31:23 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2012-09-02 12:33:13 -0700 |
commit | 8a61c24952137ee10eac107c681cdc40f876ee33 (patch) | |
tree | a8de757740a48d52b5675e695f023a3b93e5293f | |
parent | eac1eae58148227731a1d734ca989730d5321d31 (diff) | |
download | portage-8a61c24952137ee10eac107c681cdc40f876ee33.tar.gz portage-8a61c24952137ee10eac107c681cdc40f876ee33.tar.bz2 portage-8a61c24952137ee10eac107c681cdc40f876ee33.zip |
validate_desktop_entry: handle emacs.desktop
See <https://bugs.freedesktop.org/show_bug.cgi?id=35844#c6>.
-rw-r--r-- | pym/portage/util/_desktop_entry.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pym/portage/util/_desktop_entry.py b/pym/portage/util/_desktop_entry.py index deb0a35e7..bafac75d3 100644 --- a/pym/portage/util/_desktop_entry.py +++ b/pym/portage/util/_desktop_entry.py @@ -52,6 +52,12 @@ _ignore_kde_types = frozenset( # sections in /usr/share/apps/akonadi/{plugins,accountwizard} _ignore_kde_sections = ("Currency Code", "Plugin", "Wizard") +_ignored_errors = ( + # Ignore error for emacs.desktop: + # https://bugs.freedesktop.org/show_bug.cgi?id=35844#c6 + 'error: (will be fatal in the future): value "TextEditor" in key "Categories" in group "Desktop Entry" requires another category to be present among the following categories: Utility', +) + def validate_desktop_entry(path): args = ["desktop-file-validate", path] if sys.hexversion < 0x3000000 or sys.hexversion >= 0x3020000: @@ -100,6 +106,14 @@ def validate_desktop_entry(path): del output_lines[:] if output_lines: + filtered_output = [] + for line in output_lines: + if line[len(path)+2:] in _ignored_errors: + continue + filtered_output.append(line) + output_lines = filtered_output + + if output_lines: output_lines = [line for line in output_lines if _trivial_warnings.search(line) is None] |