Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 476100 | Differences between
and this patch

Collapse All | Expand All

(-)/home/pacho/gentoo-x86/eclass/gnome2-utils.eclass (-18 / +22 lines)
Lines 392-420 Link Here
392
# @DESCRIPTION:
392
# @DESCRIPTION:
393
# Updates gtk2 immodules/gdk-pixbuf loaders listing.
393
# Updates gtk2 immodules/gdk-pixbuf loaders listing.
394
gnome2_query_immodules_gtk2() {
394
gnome2_query_immodules_gtk2() {
395
	local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
395
	if has_version ">=x11-libs/gtk+-2.24.20:2"; then
396
		"${EPREFIX}/usr/bin/gtk-query-immodules-2.0" --update-cache
397
	else
398
		local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
396
399
397
	local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
400
		local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0"
398
	local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
401
		local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules"
399
	local gtk_conf_dir=$(dirname "${gtk_conf}")
402
		local gtk_conf_dir=$(dirname "${gtk_conf}")
400
403
401
	einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
404
		einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:"
402
	einfo "-> ${gtk_conf}"
405
		einfo "-> ${gtk_conf}"
403
406
404
	mkdir -p "${gtk_conf_dir}"
407
		mkdir -p "${gtk_conf_dir}"
405
	local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
408
		local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
406
	if [ -z "${tmp_file}" ]; then
409
		if [ -z "${tmp_file}" ]; then
407
		ewarn "gtk_query_immodules: cannot create temporary file"
410
			ewarn "gtk_query_immodules: cannot create temporary file"
408
		return 1
411
			return 1
409
	fi
412
		fi
410
413
411
	if ${query_exec} > "${tmp_file}"; then
414
		if ${query_exec} > "${tmp_file}"; then
412
		cat "${tmp_file}" > "${gtk_conf}" || \
415
			cat "${tmp_file}" > "${gtk_conf}" || \
413
			ewarn "Failed to write to ${gtk_conf}"
416
				ewarn "Failed to write to ${gtk_conf}"
414
	else
417
		else
415
		ewarn "Cannot update gtk.immodules, file generation failed"
418
			ewarn "Cannot update gtk.immodules, file generation failed"
419
		fi
420
		rm "${tmp_file}"
416
	fi
421
	fi
417
	rm "${tmp_file}"
418
}
422
}
419
423
420
# @FUNCTION: gnome2_query_immodules_gtk3
424
# @FUNCTION: gnome2_query_immodules_gtk3

Return to bug 476100