Magellan Linux

Contents of /trunk/include/gnome2.minc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 45 - (show annotations) (download)
Fri Apr 27 15:55:16 2012 UTC (12 years ago) by niro
File size: 2931 byte(s)
-update schemas and gio modules
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_update_schemas()
102 {
103 if [ -x ${MROOT}/usr/bin/glib-compile-schemas ]
104 then
105 ${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas
106 fi
107 }
108
109 gn2_update_gio()
110 {
111 if [ -x ${MROOT}/usr/bin/gio-querymodules ]
112 then
113 ${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules
114 fi
115 }
116
117 gn2_postinstall()
118 {
119 gn2_update_gconf
120 gn2_update_scrollkeeper
121 gn2_update_schemas
122 gn2_update_gio
123 gn2_update_desktop_db
124 gn2_update_mime_db
125 gn2_update_icon_cache
126 }
127
128 gn2_postremove()
129 {
130 gn2_update_scrollkeeper
131 gn2_update_schemas
132 gn2_update_gio
133 gn2_update_desktop_db
134 gn2_update_mime_db
135 gn2_update_icon_cache
136 }
137
138 export_inherits gn2 postinstall postremove