From 67357e051f88571638a7a809eb30497ad65424eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Marczykowski-G=C3=B3recki?= Date: Thu, 27 Aug 2015 22:41:51 +0200 Subject: [PATCH] qubes-session-autostart: do not abort the whole process on invalid file --- misc/qubes-session-autostart | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/misc/qubes-session-autostart b/misc/qubes-session-autostart index 12c9a05..fcf3439 100644 --- a/misc/qubes-session-autostart +++ b/misc/qubes-session-autostart @@ -68,14 +68,19 @@ def process_autostart(environments): # make the entry as processed, even if not actually started processed_entries[entry_name] = True - entry_path = os.path.join(path, entry_name) - # files in $HOME have higher priority than dropins - if not path.startswith(xdg.BaseDirectory.xdg_config_home): - entry = open_desktop_entry_and_dropins(entry_path) - else: - entry = DesktopEntry(entry_path) - if entry_should_be_started(entry, environments): - launch(entry_path) + try: + entry_path = os.path.join(path, entry_name) + # files in $HOME have higher priority than dropins + if not path.startswith(xdg.BaseDirectory.xdg_config_home): + entry = open_desktop_entry_and_dropins(entry_path) + else: + entry = DesktopEntry(entry_path) + if entry_should_be_started(entry, environments): + launch(entry_path) + except Exception as e: + print >>sys.stderr, "Failed to process '{}': {}".format( + entry_name, str(e) + ) def main(): process_autostart(sys.argv[1:])