build: Only update post-install caches when they exist
When building without UI, there are no icon or desktop files so there is no need to run the commands to refresh the caches. It would be even nicer to move the postinstall script to the malcontent-control subdirectory but it really applies to the installation output of the whole project, not just the malcontent-control part.
This commit is contained in:
parent
697fd56f38
commit
0d60138e0a
|
@ -7,10 +7,12 @@ import subprocess
|
|||
install_prefix = os.environ['MESON_INSTALL_PREFIX']
|
||||
|
||||
if not os.environ.get('DESTDIR'):
|
||||
print('Updating icon cache…')
|
||||
icon_cache_dir = os.path.join(install_prefix, 'share', 'icons', 'hicolor')
|
||||
if os.path.exists(icon_cache_dir):
|
||||
print('Updating icon cache…')
|
||||
subprocess.call(['gtk-update-icon-cache', '-qtf', icon_cache_dir])
|
||||
|
||||
print('Updating desktop database…')
|
||||
desktop_database_dir = os.path.join(install_prefix, 'share', 'applications')
|
||||
if os.path.exists(desktop_database_dir):
|
||||
print('Updating desktop database…')
|
||||
subprocess.call(['update-desktop-database', '-q', desktop_database_dir])
|
||||
|
|
Loading…
Reference in New Issue