1
0
mirror of https://github.com/altlinux/gpupdate.git synced 2025-03-21 18:50:38 +03:00

Shortcuts applier improvement

Run update-desktop-database utility only in case there are
shortcuts for processing present in storage.
This commit is contained in:
Игорь Чудов 2020-08-21 16:00:39 +04:00
parent 43b1ea392f
commit c8cfd51915
Signed by untrusted user: nir
GPG Key ID: 0F3883600CAE7AAC

View File

@ -99,13 +99,14 @@ class shortcut_applier(applier_frontend):
if shortcuts:
for sc in shortcuts:
write_shortcut(sc)
if len(shortcuts):
# According to ArchWiki - this thing is needed to rebuild MIME
# type cache in order file bindings to work. This rebuilds
# databases located in /usr/share/applications and
# /usr/local/share/applications
subprocess.check_call(['/usr/bin/update-desktop-database'])
else:
logging.debug(slogm('No shortcuts to process for {}'.format(self.storage.get_info('machine_sid'))))
# According to ArchWiki - this thing is needed to rebuild MIME
# type cache in order file bindings to work. This rebuilds
# databases located in /usr/share/applications and
# /usr/local/share/applications
subprocess.check_call(['/usr/bin/update-desktop-database'])
def apply(self):
if self.__module_enabled: