Annotation of /trunk/include/gnome2.minc
Parent Directory | Revision Log
Revision 40 -
(hide annotations)
(download)
Sat Jan 14 01:36:11 2012 UTC (12 years, 10 months ago) by niro
File size: 2549 byte(s)
Sat Jan 14 01:36:11 2012 UTC (12 years, 10 months ago) by niro
File size: 2549 byte(s)
Import includes from magellan-next
1 | niro | 1 | # $Header: /magellan-cvs/mage/include/gnome2.minc,v 1.13 2008/04/10 21:56:38 niro Exp $ |
2 | |||
3 | # shall we run scrollkeeper ? (per default no) | ||
4 | : ${SCROLLKEEPER_UPDATE="0"} | ||
5 | |||
6 | gn2_reload_gconf() | ||
7 | { | ||
8 | local pids | ||
9 | |||
10 | if [[ -z ${MROOT} ]] || [[ ${MROOT} = / ]] | ||
11 | then | ||
12 | # have gconf reload the new schemas | ||
13 | pids=$(pgrep -x gconfd-2) | ||
14 | if [[ $? = 0 ]] | ||
15 | then | ||
16 | echo "Reloading gconf schemas ..." | ||
17 | kill -HUP ${pids} | ||
18 | fi | ||
19 | fi | ||
20 | } | ||
21 | |||
22 | gn2_update_gconf() | ||
23 | { | ||
24 | # first update gconf | ||
25 | if [ -x ${MROOT}/usr/bin/gconftool-2 ] | ||
26 | then | ||
27 | pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null | ||
28 | local schemas=$(find 'etc/gconf/schemas/' -name '*.schemas' 2> /dev/null) | ||
29 | popd &> /dev/null | ||
30 | |||
31 | # abort here, if no schemas where found | ||
32 | [[ -z ${schemas} ]] && return | ||
33 | |||
34 | echo "Updating gconf schemas ..." | ||
35 | export GCONF_CONFIG_SOURCE=$(${MROOT}/usr/bin/gconftool-2 --get-default-source) | ||
36 | |||
37 | local i | ||
38 | for i in ${schemas} | ||
39 | do | ||
40 | # echo "DEBUG::gconf install ${i}" | ||
41 | ${MROOT}/usr/bin/gconftool-2 --makefile-install-rule ${MROOT}/${i} 1>/dev/null | ||
42 | done | ||
43 | gn2_reload_gconf | ||
44 | fi | ||
45 | } | ||
46 | |||
47 | gn2_update_scrollkeeper() | ||
48 | { | ||
49 | # than run scrollkeeper | ||
50 | if [ -x ${MROOT}/usr/bin/scrollkeeper-update ] && | ||
51 | [[ ${SCROLLKEEPER_UPDATE} = 1 ]] | ||
52 | then | ||
53 | echo "Updating scrollkeeper ..." | ||
54 | ${MROOT}/usr/bin/scrollkeeper-update -q -p ${MROOT}/var/lib/scrollkeeper | ||
55 | fi | ||
56 | } | ||
57 | |||
58 | gn2_update_desktop_db() | ||
59 | { | ||
60 | # update desktop db | ||
61 | if [ -x ${MROOT}/usr/bin/update-desktop-database ] | ||
62 | then | ||
63 | echo "Updating desktop mime database ..." | ||
64 | ${MROOT}/usr/bin/update-desktop-database -q ${MROOT}/usr/share/applications | ||
65 | fi | ||
66 | } | ||
67 | |||
68 | gn2_update_mime_db() | ||
69 | { | ||
70 | # update mime db | ||
71 | if [ -x ${MROOT}/usr/bin/update-mime-database ] | ||
72 | then | ||
73 | echo "Updating shared mime info database ..." | ||
74 | ${MROOT}/usr/bin/update-mime-database ${MROOT}/usr/share/mime | ||
75 | fi | ||
76 | } | ||
77 | |||
78 | gn2_update_icon_cache() | ||
79 | { | ||
80 | if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ] | ||
81 | then | ||
82 | pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null | ||
83 | local icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null) | ||
84 | popd &> /dev/null | ||
85 | |||
86 | # abort here, if no icons where found | ||
87 | [[ -z ${icons} ]] && return | ||
88 | |||
89 | echo "Updating icons cache ..." | ||
90 | local i | ||
91 | for i in ${icons} | ||
92 | do | ||
93 | if [[ -f ${MROOT}/${i}/index.theme ]] | ||
94 | then | ||
95 | ${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i} | ||
96 | fi | ||
97 | done | ||
98 | fi | ||
99 | } | ||
100 | |||
101 | gn2_postinstall() | ||
102 | { | ||
103 | gn2_update_gconf | ||
104 | gn2_update_scrollkeeper | ||
105 | gn2_update_desktop_db | ||
106 | gn2_update_mime_db | ||
107 | gn2_update_icon_cache | ||
108 | } | ||
109 | |||
110 | gn2_postremove() | ||
111 | { | ||
112 | gn2_update_scrollkeeper | ||
113 | gn2_update_desktop_db | ||
114 | gn2_update_mime_db | ||
115 | gn2_update_icon_cache | ||
116 | } | ||
117 | |||
118 | export_inherits gn2 postinstall postremove |