qubes-session-autostart: do not abort the whole process on invalid file

This commit is contained in:
Marek Marczykowski-Górecki 2015-08-27 22:41:51 +02:00
parent 4703e3fca7
commit 67357e051f
No known key found for this signature in database
GPG Key ID: 063938BA42CFA724

View File

@ -68,6 +68,7 @@ def process_autostart(environments):
# make the entry as processed, even if not actually started
processed_entries[entry_name] = True
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):
@ -76,6 +77,10 @@ def process_autostart(environments):
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:])