Magellan Linux

Contents of /trunk/include/gnome2.minc

Parent Directory Parent Directory | Revision Log Revision Log


Revision 74 - (show annotations) (download)
Tue Sep 2 10:37:11 2014 UTC (9 years, 8 months ago) by niro
File size: 3130 byte(s)
-gn2_update_icon_cache(): use sane defaults and only run find cmds if custom icons get installed
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 local icons
81
82 if [ -x ${MROOT}/usr/bin/gtk-update-icon-cache ]
83 then
84 if [ -d ${BUILDDIR}/${PKGNAME}/binfiles/usr/share/icons ]
85 then
86 pushd ${BUILDDIR}/${PKGNAME}/binfiles &> /dev/null
87 icons=$(find 'usr/share/icons' -maxdepth 1 -mindepth 1 -type d 2> /dev/null)
88 popd &> /dev/null
89 else
90 icons="usr/share/icons/hicolor"
91 fi
92
93 # abort here, if no icons where found
94 [[ -z ${icons} ]] && return
95
96 echo "Updating icons cache ..."
97 local i
98 for i in ${icons}
99 do
100 if [[ -f ${MROOT}/${i}/index.theme ]]
101 then
102 ${MROOT}/usr/bin/gtk-update-icon-cache -qf ${MROOT}/${i}
103 fi
104 done
105 fi
106 }
107
108 gn2_update_schemas()
109 {
110 if [ -x ${MROOT}/usr/bin/glib-compile-schemas ]
111 then
112 echo "Updating glib schemas ..."
113 ${MROOT}/usr/bin/glib-compile-schemas ${MROOT}/usr/share/glib-2.0/schemas
114 fi
115 }
116
117 gn2_update_gio()
118 {
119 if [ -x ${MROOT}/usr/bin/gio-querymodules ]
120 then
121 echo "Updating glib gio modules ..."
122 ${MROOT}/usr/bin/gio-querymodules ${MROOT}/usr/$(mlibdir)/gio/modules
123 fi
124 }
125
126 gn2_postinstall()
127 {
128 gn2_update_gconf
129 gn2_update_scrollkeeper
130 gn2_update_schemas
131 gn2_update_gio
132 gn2_update_desktop_db
133 gn2_update_mime_db
134 gn2_update_icon_cache
135 }
136
137 gn2_postremove()
138 {
139 gn2_update_scrollkeeper
140 gn2_update_schemas
141 gn2_update_gio
142 gn2_update_desktop_db
143 gn2_update_mime_db
144 gn2_update_icon_cache
145 }
146
147 export_inherits gn2 postinstall postremove