diff options
author | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
---|---|---|
committer | Richard Purdie <richard@openedhand.com> | 2006-07-21 10:10:31 +0000 |
commit | b2f192faabe412adce79534e22efe9fb69ee40e2 (patch) | |
tree | 7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/classes/gtk-icon-cache.bbclass | |
parent | 2cf0eadf9f730027833af802d7e6c90b44248f80 (diff) | |
download | poky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz |
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/classes/gtk-icon-cache.bbclass')
-rw-r--r-- | meta/classes/gtk-icon-cache.bbclass | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/meta/classes/gtk-icon-cache.bbclass b/meta/classes/gtk-icon-cache.bbclass new file mode 100644 index 0000000000..0f68e6812b --- /dev/null +++ b/meta/classes/gtk-icon-cache.bbclass | |||
@@ -0,0 +1,38 @@ | |||
1 | FILES_${PN} += "${datadir}/icons/hicolor" | ||
2 | |||
3 | gtk-icon-cache_postinst() { | ||
4 | if [ "x$D" != "x" ]; then | ||
5 | exit 1 | ||
6 | fi | ||
7 | gtk-update-icon-cache -q /usr/share/icons/hicolor | ||
8 | } | ||
9 | |||
10 | gtk-icon-cache_postrm() { | ||
11 | gtk-update-icon-cache -q /usr/share/icons/hicolor | ||
12 | } | ||
13 | |||
14 | python populate_packages_append () { | ||
15 | import os.path | ||
16 | packages = bb.data.getVar('PACKAGES', d, 1).split() | ||
17 | workdir = bb.data.getVar('WORKDIR', d, 1) | ||
18 | |||
19 | for pkg in packages: | ||
20 | icon_dir = '%s/install/%s/%s/icons/hicolor' % (workdir, pkg, bb.data.getVar('datadir', d, 1)) | ||
21 | if not os.path.exists(icon_dir): | ||
22 | continue | ||
23 | |||
24 | bb.note("adding gtk-icon-cache postinst and postrm scripts to %s" % pkg) | ||
25 | |||
26 | postinst = bb.data.getVar('pkg_postinst_%s' % pkg, d, 1) or bb.data.getVar('pkg_postinst', d, 1) | ||
27 | if not postinst: | ||
28 | postinst = '#!/bin/sh\n' | ||
29 | postinst += bb.data.getVar('gtk-icon-cache_postinst', d, 1) | ||
30 | bb.data.setVar('pkg_postinst_%s' % pkg, postinst, d) | ||
31 | |||
32 | postrm = bb.data.getVar('pkg_postrm_%s' % pkg, d, 1) or bb.data.getVar('pkg_postrm', d, 1) | ||
33 | if not postrm: | ||
34 | postrm = '#!/bin/sh\n' | ||
35 | postrm += bb.data.getVar('gtk-icon-cache_postrm', d, 1) | ||
36 | bb.data.setVar('pkg_postrm_%s' % pkg, postrm, d) | ||
37 | } | ||
38 | |||