gnome-control-center/meson_post_install.py
Iñigo Martínez 32edd6789e build: Port to meson build system
Meson is a build system focused on speed an ease of use, which
helps speeding up the software development. This patch adds meson
support along autotools.

https://bugzilla.gnome.org/show_bug.cgi?id=785414
2018-01-17 20:09:35 -02:00

19 lines
538 B
Python

#!/usr/bin/env python3
import glob
import os
import re
import subprocess
import sys
icondir = os.path.join(sys.argv[1], 'icons', 'hicolor')
name_pattern = re.compile('hicolor_(?:apps)_(?:\d+x\d+|symbolic)_(.*)')
search_pattern = '/**/hicolor_*'
[os.rename(file, os.path.join(os.path.dirname(file), name_pattern.search(file).group(1)))
for file in glob.glob(icondir + search_pattern, recursive=True)]
if not os.environ.get('DESTDIR'):
print('Update icon cache...')
subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])