summaryrefslogtreecommitdiffstats
path: root/meta/classes/pixbufcache.bbclass
diff options
context:
space:
mode:
authorLaurentiu Palcu <laurentiu.palcu@intel.com>2013-02-12 18:12:41 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-02-13 16:52:29 +0000
commit2b2416098eaf6f98ebe22c86e550d648edcb90f2 (patch)
tree1e3e519674892479b77adcafac9ff15c23b33abe /meta/classes/pixbufcache.bbclass
parentb4c89bdae3778f2bf7596c1f3ca9fdaf7d480614 (diff)
downloadpoky-2b2416098eaf6f98ebe22c86e550d648edcb90f2.tar.gz
Add pixbufcache class
All packages exporting pixbuf loaders should inherit this class in order to generate the correct postinst/postrm scriptlets. [YOCTO #3852] (From OE-Core rev: 61afa98f96f5c62473cb2db383b48d3d23c5d7ac) Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/pixbufcache.bbclass')
-rw-r--r--meta/classes/pixbufcache.bbclass50
1 files changed, 50 insertions, 0 deletions
diff --git a/meta/classes/pixbufcache.bbclass b/meta/classes/pixbufcache.bbclass
new file mode 100644
index 0000000000..fc749dee50
--- /dev/null
+++ b/meta/classes/pixbufcache.bbclass
@@ -0,0 +1,50 @@
1#
2# This class will generate the proper postinst/postrm scriptlets for pixbuf
3# packages.
4#
5
6DEPENDS += "qemu-native"
7inherit qemu
8
9PIXBUF_PACKAGES ??= "${PN}"
10
11#
12# On host, the postinstall MUST return 1 because we do not know if the intercept
13# hook will succeed. If it does succeed, than the packages will be marked as
14# installed.
15#
16pixbufcache_common() {
17if [ "x$D" != "x" ]; then
18 $INTERCEPT_DIR/postinst_intercept update_pixbuf_cache ${PKG} libdir=${libdir} bindir=${bindir}
19 exit 1
20fi
21
22# Update the pixbuf loaders in case they haven't been registered yet
23GDK_PIXBUF_MODULEDIR=${libdir}/gdk-pixbuf-2.0/2.10.0/loaders gdk-pixbuf-query-loaders --update-cache
24
25if [ -x ${bindir}/gtk-update-icon-cache ] && [ -d ${datadir}/icons ]; then
26 for icondir in /usr/share/icons/*; do
27 if [ -d ${icondir} ]; then
28 gtk-update-icon-cache -t -q ${icondir}
29 fi
30 done
31fi
32}
33
34python populate_packages_append() {
35 pixbuf_pkgs = d.getVar('PIXBUF_PACKAGES', True).split()
36
37 for pkg in pixbuf_pkgs:
38 bb.note("adding pixbuf postinst and postrm scripts to %s" % pkg)
39 postinst = d.getVar('pkg_postinst_%s' % pkg, True) or d.getVar('pkg_postinst', True)
40 if not postinst:
41 postinst = '#!/bin/sh\n'
42 postinst += d.getVar('pixbufcache_common', True)
43 d.setVar('pkg_postinst_%s' % pkg, postinst)
44
45 postrm = d.getVar('pkg_postrm_%s' % pkg, True) or d.getVar('pkg_postrm', True)
46 if not postrm:
47 postrm = '#!/bin/sh\n'
48 postrm += d.getVar('pixbufcache_common', True)
49 d.setVar('pkg_postrm_%s' % pkg, postrm)
50}