Debian Codegraph @

data/icons/meson_updateiconcache.py

raw
1 #!/usr/bin/env python3
2 # Copyright © 2019 Christian Persch
3 #
4 # This programme is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or (at your
7 # option) any later version.
8 #
9 # This programme is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
12 # See the GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this programme. If not, see <https://www.gnu.org/licenses/>.
16
17 import os
18 import subprocess
19 import sys
20
21 if os.environ.get('DESTDIR'):
22 sys.exit(0)
23
24 prefix = os.environ['MESON_INSTALL_PREFIX']
25 icondir = os.path.join(prefix, sys.argv[1])
26
27 rv = subprocess.call(['gtk-update-icon-cache', '-f', '-t', icondir])
28 sys.exit(0)