Gentoo Archives: gentoo-commits

From: "Anthony G. Basile" <blueness@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: dev-libs/glib/, dev-libs/glib/files/
Date: Wed, 21 Aug 2019 12:55:35
Message-Id: 1566392111.1cff7d041fe6e0054c7d0cd5dadede5fd62271f8.blueness@gentoo
1 commit: 1cff7d041fe6e0054c7d0cd5dadede5fd62271f8
2 Author: stefson <herrtimson <AT> yahoo <DOT> de>
3 AuthorDate: Thu Jul 25 15:26:42 2019 +0000
4 Commit: Anthony G. Basile <blueness <AT> gentoo <DOT> org>
5 CommitDate: Wed Aug 21 12:55:11 2019 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=1cff7d04
7
8 dev-libs/glib: add 2.58.3-r1 from tree
9
10 Bug: https://bugs.gentoo.org/690498
11 Signed-off-by: Steffen Kuhn <nielson2 <AT> yandex.com>
12 Signed-off-by: Anthony G. Basile <blueness <AT> gentoo.org>
13
14 dev-libs/glib/files/2.58.3-CVE-2019-12450.patch | 53 ++++
15 .../glib/files/2.58.3-gdbusmessage-limit-fix.patch | 120 ++++++++
16 dev-libs/glib/glib-2.58.3-r1.ebuild | 320 +++++++++++++++++++++
17 3 files changed, 493 insertions(+)
18
19 diff --git a/dev-libs/glib/files/2.58.3-CVE-2019-12450.patch b/dev-libs/glib/files/2.58.3-CVE-2019-12450.patch
20 new file mode 100644
21 index 0000000..949ac56
22 --- /dev/null
23 +++ b/dev-libs/glib/files/2.58.3-CVE-2019-12450.patch
24 @@ -0,0 +1,53 @@
25 +From e6b769819d63d2b24b251dbc9f902fe6fd614da3 Mon Sep 17 00:00:00 2001
26 +From: Ondrej Holy <oholy@××××××.com>
27 +Date: Thu, 23 May 2019 10:41:53 +0200
28 +Subject: [PATCH] gfile: Limit access to files when copying
29 +
30 +file_copy_fallback creates new files with default permissions and
31 +set the correct permissions after the operation is finished. This
32 +might cause that the files can be accessible by more users during
33 +the operation than expected. Use G_FILE_CREATE_PRIVATE for the new
34 +files to limit access to those files.
35 +---
36 + gio/gfile.c | 11 ++++++-----
37 + 1 file changed, 6 insertions(+), 5 deletions(-)
38 +
39 +diff --git a/gio/gfile.c b/gio/gfile.c
40 +index 1cc69166a..13b435480 100644
41 +--- a/gio/gfile.c
42 ++++ b/gio/gfile.c
43 +@@ -3284,12 +3284,12 @@ file_copy_fallback (GFile *source,
44 + out = (GOutputStream*)_g_local_file_output_stream_replace (_g_local_file_get_filename (G_LOCAL_FILE (destination)),
45 + FALSE, NULL,
46 + flags & G_FILE_COPY_BACKUP,
47 +- G_FILE_CREATE_REPLACE_DESTINATION,
48 +- info,
49 ++ G_FILE_CREATE_REPLACE_DESTINATION |
50 ++ G_FILE_CREATE_PRIVATE, info,
51 + cancellable, error);
52 + else
53 + out = (GOutputStream*)_g_local_file_output_stream_create (_g_local_file_get_filename (G_LOCAL_FILE (destination)),
54 +- FALSE, 0, info,
55 ++ FALSE, G_FILE_CREATE_PRIVATE, info,
56 + cancellable, error);
57 + }
58 + else if (flags & G_FILE_COPY_OVERWRITE)
59 +@@ -3297,12 +3297,13 @@ file_copy_fallback (GFile *source,
60 + out = (GOutputStream *)g_file_replace (destination,
61 + NULL,
62 + flags & G_FILE_COPY_BACKUP,
63 +- G_FILE_CREATE_REPLACE_DESTINATION,
64 ++ G_FILE_CREATE_REPLACE_DESTINATION |
65 ++ G_FILE_CREATE_PRIVATE,
66 + cancellable, error);
67 + }
68 + else
69 + {
70 +- out = (GOutputStream *)g_file_create (destination, 0, cancellable, error);
71 ++ out = (GOutputStream *)g_file_create (destination, G_FILE_CREATE_PRIVATE, cancellable, error);
72 + }
73 +
74 + if (!out)
75 +--
76 +2.20.1
77 +
78
79 diff --git a/dev-libs/glib/files/2.58.3-gdbusmessage-limit-fix.patch b/dev-libs/glib/files/2.58.3-gdbusmessage-limit-fix.patch
80 new file mode 100644
81 index 0000000..0828132
82 --- /dev/null
83 +++ b/dev-libs/glib/files/2.58.3-gdbusmessage-limit-fix.patch
84 @@ -0,0 +1,120 @@
85 +From 2d655ef8954695cabf9e99cc61411de2bb4cb847 Mon Sep 17 00:00:00 2001
86 +From: Philip Withnall <withnall@××××××××.com>
87 +Date: Mon, 28 Jan 2019 14:36:42 +0000
88 +Subject: [PATCH] gdbusmessage: Fix check on upper limit of message size
89 +
90 +There was a typo in the figure checked against. Add a unit test.
91 +
92 +Signed-off-by: Philip Withnall <withnall@××××××××.com>
93 +
94 +https://gitlab.gnome.org/GNOME/glib/issues/1642
95 +---
96 + gio/gdbusmessage.c | 2 +-
97 + gio/tests/gdbus-message.c | 72 ++++++++++++++++++++++++++++++++++++++-
98 + 2 files changed, 72 insertions(+), 2 deletions(-)
99 +
100 +diff --git a/gio/gdbusmessage.c b/gio/gdbusmessage.c
101 +index 169e6fd15..2ad51f888 100644
102 +--- a/gio/gdbusmessage.c
103 ++++ b/gio/gdbusmessage.c
104 +@@ -1984,7 +1984,7 @@ g_dbus_message_bytes_needed (guchar *blob,
105 + "Unable to determine message blob length - given blob is malformed");
106 + }
107 +
108 +- if (ret > (2<<27))
109 ++ if (ret > (1<<27))
110 + {
111 + g_set_error (error,
112 + G_IO_ERROR,
113 +diff --git a/gio/tests/gdbus-message.c b/gio/tests/gdbus-message.c
114 +index 88a9c5d86..74e0f712e 100644
115 +--- a/gio/tests/gdbus-message.c
116 ++++ b/gio/tests/gdbus-message.c
117 +@@ -141,6 +141,74 @@ message_copy (void)
118 +
119 + /* ---------------------------------------------------------------------------------------------------- */
120 +
121 ++/* Test g_dbus_message_bytes_needed() returns correct results for a variety of
122 ++ * arbitrary binary inputs.*/
123 ++static void
124 ++message_bytes_needed (void)
125 ++{
126 ++ const struct
127 ++ {
128 ++ const guint8 blob[16];
129 ++ gssize expected_bytes_needed;
130 ++ }
131 ++ vectors[] =
132 ++ {
133 ++ /* Little endian with header rounding */
134 ++ { { 'l', 0, 0, 1, /* endianness, message type, flags, protocol version */
135 ++ 50, 0, 0, 0, /* body length */
136 ++ 1, 0, 0, 0, /* message serial */
137 ++ 7, 0, 0, 0 /* header length */}, 74 },
138 ++ /* Little endian without header rounding */
139 ++ { { 'l', 0, 0, 1, /* endianness, message type, flags, protocol version */
140 ++ 50, 0, 0, 0, /* body length */
141 ++ 1, 0, 0, 0, /* message serial */
142 ++ 8, 0, 0, 0 /* header length */}, 74 },
143 ++ /* Big endian with header rounding */
144 ++ { { 'B', 0, 0, 1, /* endianness, message type, flags, protocol version */
145 ++ 0, 0, 0, 50, /* body length */
146 ++ 0, 0, 0, 1, /* message serial */
147 ++ 0, 0, 0, 7 /* header length */}, 74 },
148 ++ /* Big endian without header rounding */
149 ++ { { 'B', 0, 0, 1, /* endianness, message type, flags, protocol version */
150 ++ 0, 0, 0, 50, /* body length */
151 ++ 0, 0, 0, 1, /* message serial */
152 ++ 0, 0, 0, 8 /* header length */}, 74 },
153 ++ /* Invalid endianness */
154 ++ { { '!', 0, 0, 1, /* endianness, message type, flags, protocol version */
155 ++ 0, 0, 0, 50, /* body length */
156 ++ 0, 0, 0, 1, /* message serial */
157 ++ 0, 0, 0, 8 /* header length */}, -1 },
158 ++ /* Oversized */
159 ++ { { 'l', 0, 0, 1, /* endianness, message type, flags, protocol version */
160 ++ 0, 0, 0, 0x08, /* body length (128MiB) */
161 ++ 1, 0, 0, 0, /* message serial */
162 ++ 7, 0, 0, 0 /* header length */}, -1 },
163 ++ };
164 ++ gsize i;
165 ++
166 ++ for (i = 0; i < G_N_ELEMENTS (vectors); i++)
167 ++ {
168 ++ gssize bytes_needed;
169 ++ GError *local_error = NULL;
170 ++
171 ++ g_test_message ("Vector: %" G_GSIZE_FORMAT, i);
172 ++
173 ++ bytes_needed = g_dbus_message_bytes_needed ((guchar *) vectors[i].blob,
174 ++ G_N_ELEMENTS (vectors[i].blob),
175 ++ &local_error);
176 ++
177 ++ if (vectors[i].expected_bytes_needed < 0)
178 ++ g_assert_error (local_error, G_IO_ERROR, G_IO_ERROR_INVALID_ARGUMENT);
179 ++ else
180 ++ g_assert_no_error (local_error);
181 ++ g_assert_cmpint (bytes_needed, ==, vectors[i].expected_bytes_needed);
182 ++
183 ++ g_clear_error (&local_error);
184 ++ }
185 ++}
186 ++
187 ++/* ---------------------------------------------------------------------------------------------------- */
188 ++
189 + int
190 + main (int argc,
191 + char *argv[])
192 +@@ -151,6 +219,8 @@ main (int argc,
193 +
194 + g_test_add_func ("/gdbus/message/lock", message_lock);
195 + g_test_add_func ("/gdbus/message/copy", message_copy);
196 +- return g_test_run();
197 ++ g_test_add_func ("/gdbus/message/bytes-needed", message_bytes_needed);
198 ++
199 ++ return g_test_run ();
200 + }
201 +
202 +--
203 +2.20.1
204 +
205
206 diff --git a/dev-libs/glib/glib-2.58.3-r1.ebuild b/dev-libs/glib/glib-2.58.3-r1.ebuild
207 new file mode 100644
208 index 0000000..cb0cf13
209 --- /dev/null
210 +++ b/dev-libs/glib/glib-2.58.3-r1.ebuild
211 @@ -0,0 +1,320 @@
212 +# Copyright 1999-2018 Gentoo Authors
213 +# Distributed under the terms of the GNU General Public License v2
214 +
215 +EAPI=6
216 +PYTHON_COMPAT=( python{2_7,3_5,3_6,3_7} )
217 +GNOME2_EAUTORECONF=yes
218 +
219 +inherit autotools bash-completion-r1 epunt-cxx flag-o-matic gnome2 libtool linux-info \
220 + multilib multilib-minimal pax-utils python-any-r1 toolchain-funcs virtualx
221 +
222 +# Until bug #537330 glib is a reverse dependency of pkgconfig and, then
223 +# adding new dependencies end up making stage3 to grow. Every addition needs
224 +# then to be think very closely.
225 +
226 +DESCRIPTION="The GLib library of C routines"
227 +HOMEPAGE="https://www.gtk.org/"
228 +SRC_URI="${SRC_URI}
229 + https://pkgconfig.freedesktop.org/releases/pkg-config-0.28.tar.gz" # pkg.m4 for eautoreconf
230 +
231 +LICENSE="LGPL-2.1+"
232 +SLOT="2"
233 +IUSE="dbus debug fam gtk-doc kernel_linux +mime selinux static-libs systemtap test utils xattr"
234 +
235 +KEYWORDS="amd64 ~arm arm64 ~mips ~ppc x86"
236 +
237 +# Added util-linux multilib dependency to have libmount support (which
238 +# is always turned on on linux systems, unless explicitly disabled, but
239 +# this ebuild does not do that anyway) (bug #599586)
240 +
241 +RDEPEND="
242 + !<dev-util/gdbus-codegen-${PV}
243 + >=dev-libs/libpcre-8.31:3[${MULTILIB_USEDEP},static-libs?]
244 + >=virtual/libiconv-0-r1[${MULTILIB_USEDEP}]
245 + >=virtual/libffi-3.0.13-r1:=[${MULTILIB_USEDEP}]
246 + >=virtual/libintl-0-r2[${MULTILIB_USEDEP}]
247 + >=sys-libs/zlib-1.2.8-r1[${MULTILIB_USEDEP}]
248 + kernel_linux? ( >=sys-apps/util-linux-2.23[${MULTILIB_USEDEP}] )
249 + selinux? ( >=sys-libs/libselinux-2.2.2-r5[${MULTILIB_USEDEP}] )
250 + xattr? ( >=sys-apps/attr-2.4.47-r1[${MULTILIB_USEDEP}] )
251 + fam? ( >=virtual/fam-0-r1[${MULTILIB_USEDEP}] )
252 + utils? (
253 + >=dev-util/gdbus-codegen-${PV}
254 + virtual/libelf:0=
255 + )
256 +"
257 +DEPEND="${RDEPEND}
258 + app-text/docbook-xml-dtd:4.1.2
259 + app-text/docbook-xsl-stylesheets
260 + >=dev-libs/libxslt-1.0
261 + >=sys-devel/gettext-0.11
262 + gtk-doc? ( >=dev-util/gtk-doc-1.20 )
263 + systemtap? ( >=dev-util/systemtap-1.3 )
264 + ${PYTHON_DEPS}
265 + test? (
266 + sys-devel/gdb
267 + >=dev-util/gdbus-codegen-${PV}
268 + >=sys-apps/dbus-1.2.14 )
269 +"
270 +# configure.ac has gtk-doc-am stuff behind m4_ifdef, so we don't need a gtk-doc-am build dep
271 +
272 +# Migration of glib-genmarshal, glib-mkenums and gtester-report to a separate
273 +# python depending package, which can be buildtime depended in packages that
274 +# need these tools, without pulling in python at runtime.
275 +RDEPEND="${RDEPEND}
276 + >=dev-util/glib-utils-${PV}"
277 +PDEPEND="
278 + dbus? ( gnome-base/dconf )
279 + mime? ( x11-misc/shared-mime-info )
280 +"
281 +# shared-mime-info needed for gio/xdgmime, bug #409481
282 +# dconf is needed to be able to save settings, bug #498436
283 +
284 +MULTILIB_CHOST_TOOLS=(
285 + /usr/bin/gio-querymodules$(get_exeext)
286 +)
287 +
288 +pkg_setup() {
289 + if use kernel_linux ; then
290 + CONFIG_CHECK="~INOTIFY_USER"
291 + if use test ; then
292 + CONFIG_CHECK="~IPV6"
293 + WARNING_IPV6="Your kernel needs IPV6 support for running some tests, skipping them."
294 + fi
295 + linux-info_pkg_setup
296 + fi
297 + python-any-r1_pkg_setup
298 +}
299 +
300 +src_prepare() {
301 +
302 + # Musl fix
303 + eapply "${FILESDIR}/2.56.2-quark_init_on_demand.patch"
304 + eapply "${FILESDIR}/2.56.2-gobject_init_on_demand.patch"
305 +
306 + # Prevent build failure in stage3 where pkgconfig is not available, bug #481056
307 + mv -f "${WORKDIR}"/pkg-config-*/pkg.m4 "${S}"/m4macros/ || die
308 +
309 + if use test; then
310 + # Disable tests requiring dev-util/desktop-file-utils when not installed, bug #286629, upstream bug #629163
311 + if ! has_version dev-util/desktop-file-utils ; then
312 + ewarn "Some tests will be skipped due dev-util/desktop-file-utils not being present on your system,"
313 + ewarn "think on installing it to get these tests run."
314 + sed -i -e "/appinfo\/associations/d" gio/tests/appinfo.c || die
315 + sed -i -e "/g_test_add_func/d" gio/tests/desktop-app-info.c || die
316 + fi
317 +
318 + # gdesktopappinfo requires existing terminal (gnome-terminal or any
319 + # other), falling back to xterm if one doesn't exist
320 + #if ! has_version x11-terms/xterm && ! has_version x11-terms/gnome-terminal ; then
321 + # ewarn "Some tests will be skipped due to missing terminal program"
322 + # These tests seem to sometimes fail even with a terminal; skip for now and reevulate with meson
323 + # Also try https://gitlab.gnome.org/GNOME/glib/issues/1601 once ready for backport (or in a bump) and file new issue if still fails
324 + sed -i -e "/appinfo\/launch/d" gio/tests/appinfo.c || die
325 + # desktop-app-info/launch* might fail similarly
326 + sed -i -e "/desktop-app-info\/launch-as-manager/d" gio/tests/desktop-app-info.c || die
327 + #fi
328 +
329 + # https://bugzilla.gnome.org/show_bug.cgi?id=722604
330 + sed -i -e "/timer\/stop/d" glib/tests/timer.c || die
331 + sed -i -e "/timer\/basic/d" glib/tests/timer.c || die
332 +
333 + ewarn "Tests for search-utils have been skipped"
334 + sed -i -e "/search-utils/d" glib/tests/Makefile.am || die
335 + else
336 + # Don't build tests, also prevents extra deps, bug #512022
337 + sed -i -e 's/ tests//' {.,gio,glib}/Makefile.am || die
338 + fi
339 +
340 + # gdbus-codegen is a separate package
341 + eapply "${FILESDIR}"/${PN}-2.58.2-external-gdbus-codegen.patch
342 +
343 + # gdbus message upper limit check fix from glib-2-58
344 + eapply "${FILESDIR}"/${PV}-gdbusmessage-limit-fix.patch
345 + # gfile copy fallback security fix (wrong permissions at start)
346 + eapply "${FILESDIR}"/${PV}-CVE-2019-12450.patch
347 +
348 + # Tarball doesn't come with gtk-doc.make and we can't unconditionally depend on dev-util/gtk-doc due
349 + # to circular deps during bootstramp. If actually not building gtk-doc, an almost empty file will do
350 + # fine as well - this is also what upstream autogen.sh does if gtkdocize is not found. If gtk-doc is
351 + # installed, eautoreconf will call gtkdocize, which overwrites the empty gtk-doc.make with a full copy.
352 + cat > gtk-doc.make << EOF
353 +EXTRA_DIST =
354 +CLEANFILES =
355 +EOF
356 +
357 + gnome2_src_prepare
358 + epunt_cxx
359 +}
360 +
361 +multilib_src_configure() {
362 + # Avoid circular depend with dev-util/pkgconfig and
363 + # native builds (cross-compiles won't need pkg-config
364 + # in the target ROOT to work here)
365 + if ! tc-is-cross-compiler && ! $(tc-getPKG_CONFIG) --version >& /dev/null; then
366 + if has_version sys-apps/dbus; then
367 + export DBUS1_CFLAGS="-I/usr/include/dbus-1.0 -I/usr/$(get_libdir)/dbus-1.0/include"
368 + export DBUS1_LIBS="-ldbus-1"
369 + fi
370 + export LIBFFI_CFLAGS="-I$(echo /usr/$(get_libdir)/libffi-*/include)"
371 + export LIBFFI_LIBS="-lffi"
372 + export PCRE_CFLAGS=" " # test -n "$PCRE_CFLAGS" needs to pass
373 + export PCRE_LIBS="-lpcre"
374 + fi
375 +
376 + # These configure tests don't work when cross-compiling.
377 + if tc-is-cross-compiler ; then
378 + # https://bugzilla.gnome.org/show_bug.cgi?id=756473
379 + case ${CHOST} in
380 + hppa*|metag*) export glib_cv_stack_grows=yes ;;
381 + *) export glib_cv_stack_grows=no ;;
382 + esac
383 + # https://bugzilla.gnome.org/show_bug.cgi?id=756474
384 + export glib_cv_uscore=no
385 + # https://bugzilla.gnome.org/show_bug.cgi?id=756475
386 + export ac_cv_func_posix_get{pwuid,grgid}_r=yes
387 + fi
388 +
389 + local myconf
390 +
391 + case "${CHOST}" in
392 + *-mingw*) myconf="${myconf} --with-threads=win32" ;;
393 + *) myconf="${myconf} --with-threads=posix" ;;
394 + esac
395 +
396 + # libelf used only by the gresource bin
397 + ECONF_SOURCE="${S}" gnome2_src_configure ${myconf} \
398 + $(usex debug --enable-debug=yes ' ') \
399 + $(use_enable xattr) \
400 + $(use_enable fam) \
401 + $(multilib_native_use_enable gtk-doc) \
402 + $(use_enable kernel_linux libmount) \
403 + $(use_enable selinux) \
404 + $(use_enable static-libs static) \
405 + $(use_enable systemtap dtrace) \
406 + $(use_enable systemtap systemtap) \
407 + $(multilib_native_use_enable utils libelf) \
408 + --with-python=${EPYTHON} \
409 + --disable-compile-warnings \
410 + --enable-man \
411 + --with-pcre=system \
412 + --with-xml-catalog="${EPREFIX}/etc/xml/catalog"
413 +
414 + if multilib_is_native_abi; then
415 + local d
416 + for d in glib gio gobject; do
417 + ln -s "${S}"/docs/reference/${d}/html docs/reference/${d}/html || die
418 + done
419 + fi
420 +}
421 +
422 +multilib_src_test() {
423 + export XDG_CONFIG_DIRS=/etc/xdg
424 + export XDG_DATA_DIRS=/usr/local/share:/usr/share
425 + export G_DBUS_COOKIE_SHA1_KEYRING_DIR="${T}/temp"
426 + export LC_TIME=C # bug #411967
427 + unset GSETTINGS_BACKEND # bug #596380
428 + python_setup
429 +
430 + # Related test is a bit nitpicking
431 + mkdir "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
432 + chmod 0700 "$G_DBUS_COOKIE_SHA1_KEYRING_DIR"
433 +
434 + # Hardened: gdb needs this, bug #338891
435 + if host-is-pax ; then
436 + pax-mark -mr "${BUILD_DIR}"/tests/.libs/assert-msg-test \
437 + || die "Hardened adjustment failed"
438 + fi
439 +
440 + # Need X for dbus-launch session X11 initialization
441 + virtx emake check
442 +}
443 +
444 +multilib_src_install() {
445 + emake DESTDIR="${D}" completiondir="$(get_bashcompdir)" install
446 + keepdir /usr/$(get_libdir)/gio/modules
447 +}
448 +
449 +multilib_src_install_all() {
450 + einstalldocs
451 +
452 + # These are installed by dev-util/glib-utils
453 + # TODO: With patching we might be able to get rid of the python-any deps and removals, and test depend on glib-utils instead; revisit with meson
454 + rm "${ED}usr/bin/glib-genmarshal" || die
455 + rm "${ED}usr/share/man/man1/glib-genmarshal.1" || die
456 + rm "${ED}usr/bin/glib-mkenums" || die
457 + rm "${ED}usr/share/man/man1/glib-mkenums.1" || die
458 + rm "${ED}usr/bin/gtester-report" || die
459 + rm "${ED}usr/share/man/man1/gtester-report.1" || die
460 +
461 + # Do not install charset.alias even if generated, leave it to libiconv
462 + rm -f "${ED}/usr/$(get_libdir)/charset.alias"
463 +
464 + # Don't install gdb python macros, bug 291328
465 + rm -rf "${ED}/usr/share/gdb/" "${ED}/usr/share/glib-2.0/gdb/"
466 +
467 + # Completely useless with or without USE static-libs, people need to use pkg-config
468 + find "${ED}" -name '*.la' -delete || die
469 +}
470 +
471 +pkg_preinst() {
472 + gnome2_pkg_preinst
473 +
474 + # Make gschemas.compiled belong to glib alone
475 + local cache="usr/share/glib-2.0/schemas/gschemas.compiled"
476 +
477 + if [[ -e ${EROOT}${cache} ]]; then
478 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
479 + else
480 + touch "${ED}"/${cache} || die
481 + fi
482 +
483 + multilib_pkg_preinst() {
484 + # Make giomodule.cache belong to glib alone
485 + local cache="usr/$(get_libdir)/gio/modules/giomodule.cache"
486 +
487 + if [[ -e ${EROOT}${cache} ]]; then
488 + cp "${EROOT}"${cache} "${ED}"/${cache} || die
489 + else
490 + touch "${ED}"/${cache} || die
491 + fi
492 + }
493 +
494 + # Don't run the cache ownership when cross-compiling, as it would end up with an empty cache
495 + # file due to inability to create it and GIO might not look at any of the modules there
496 + if ! tc-is-cross-compiler ; then
497 + multilib_foreach_abi multilib_pkg_preinst
498 + fi
499 +}
500 +
501 +pkg_postinst() {
502 + # force (re)generation of gschemas.compiled
503 + GNOME2_ECLASS_GLIB_SCHEMAS="force"
504 +
505 + gnome2_pkg_postinst
506 +
507 + multilib_pkg_postinst() {
508 + gnome2_giomodule_cache_update \
509 + || die "Update GIO modules cache failed (for ${ABI})"
510 + }
511 + if ! tc-is-cross-compiler ; then
512 + multilib_foreach_abi multilib_pkg_postinst
513 + else
514 + ewarn "Updating of GIO modules cache skipped due to cross-compilation."
515 + ewarn "You might want to run gio-querymodules manually on the target for"
516 + ewarn "your final image for performance reasons and re-run it when packages"
517 + ewarn "installing GIO modules get upgraded or added to the image."
518 + fi
519 +}
520 +
521 +pkg_postrm() {
522 + gnome2_pkg_postrm
523 +
524 + if [[ -z ${REPLACED_BY_VERSION} ]]; then
525 + multilib_pkg_postrm() {
526 + rm -f "${EROOT}"usr/$(get_libdir)/gio/modules/giomodule.cache
527 + }
528 + multilib_foreach_abi multilib_pkg_postrm
529 + rm -f "${EROOT}"usr/share/glib-2.0/schemas/gschemas.compiled
530 + fi
531 +}