summaryrefslogtreecommitdiffstats
path: root/pym/portage/util/_desktop_entry.py
diff options
context:
space:
mode:
authorMichael Palimaka <kensington@gentoo.org>2012-09-12 03:22:05 +1000
committerZac Medico <zmedico@gentoo.org>2012-09-11 10:46:57 -0700
commit9f735963c000f0e925b513c5378b2552476c0e8e (patch)
tree341feefb6961ae64ef2e5582c2b0b291459f0372 /pym/portage/util/_desktop_entry.py
parentc512c31e3ce0f53ac3ad4d59a577503413704174 (diff)
downloadportage-9f735963c000f0e925b513c5378b2552476c0e8e.tar.gz
portage-9f735963c000f0e925b513c5378b2552476c0e8e.tar.bz2
portage-9f735963c000f0e925b513c5378b2552476c0e8e.zip
Only validate .desktop files that are installed into XDG-compliant locations.
This replaces the existing error blacklist, and therefore removes the repoman check.
Diffstat (limited to 'pym/portage/util/_desktop_entry.py')
-rw-r--r--pym/portage/util/_desktop_entry.py57
1 files changed, 3 insertions, 54 deletions
diff --git a/pym/portage/util/_desktop_entry.py b/pym/portage/util/_desktop_entry.py
index aa730ded3..2973d12ff 100644
--- a/pym/portage/util/_desktop_entry.py
+++ b/pym/portage/util/_desktop_entry.py
@@ -42,20 +42,6 @@ def parse_desktop_entry(path):
return parser
_trivial_warnings = re.compile(r' looks redundant with value ')
-_ignore_kde_key_re = re.compile(r'^\s*(configurationType\s*=|Type\s*=\s*Service)')
-_ignore_kde_types = frozenset(
- ["AkonadiAgent", "AkonadiResource", "Service", "ServiceType", "XSession"])
-
-# kdebase-data installs files with [Currency Code] sections
-# in /usr/share/locale/currency
-# kdepim-runtime installs files with [Plugin] and [Wizard]
-# sections in /usr/share/apps/akonadi/{plugins,accountwizard}
-# kdm installs files with [KCM Locale], [KDE Desktop Pattern],
-# [KdmGreeterTheme] and [Wallpaper] sections in various directories
-# libkdegames installs files with [KDE Backdeck] sections in
-# /usr/share/apps/carddecks/
-# Various KDE games install files with [KGameTheme] sections
-_ignore_kde_sections = ("Currency Code", "KCM Locale", "KDE Backdeck", "KDE Desktop Pattern", "KDE Desktop Program", "KdmGreeterTheme", "KGameTheme", "Plugin", "Wallpaper", "Wizard")
_ignored_errors = (
# Ignore error for emacs.desktop:
@@ -74,48 +60,11 @@ def validate_desktop_entry(path):
proc.wait()
if output_lines:
- # Ignore kde extensions for bug #414125 and bug #432862.
- try:
- desktop_entry = parse_desktop_entry(path)
- except ConfigParserError:
- with io.open(_unicode_encode(path,
- encoding=_encodings['fs'], errors='strict'),
- mode='r', encoding=_encodings['repo.content'],
- errors='replace') as f:
- for line in f:
- if _ignore_kde_key_re.match(line):
- # Ignore kde extensions for bug #432862.
- del output_lines[:]
- break
- else:
- if desktop_entry.has_section("Desktop Entry"):
- try:
- entry_type = desktop_entry.get("Desktop Entry", "Type")
- except ConfigParserError:
- pass
- else:
- if entry_type in _ignore_kde_types:
- del output_lines[:]
- try:
- desktop_entry.get("Desktop Entry", "Hidden")
- except ConfigParserError:
- pass
- else:
- # The "Hidden" key appears to be unique to special kde
- # service files (which don't validate well), installed
- # in /usr/share/kde4/services/ by packages like
- # nepomuk-core and kurifilter-plugins.
- del output_lines[:]
- for section in _ignore_kde_sections:
- if desktop_entry.has_section(section):
- 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)
+ if line[len(path)+2:] in _ignored_errors:
+ continue
+ filtered_output.append(line)
output_lines = filtered_output
if output_lines: