/[gentoo-x86]/eclass/gnome2-utils.eclass
Gentoo

Diff of /eclass/gnome2-utils.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.37 Revision 1.38
1# Copyright 1999-2014 Gentoo Foundation 1# Copyright 1999-2014 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.37 2014/11/23 15:00:44 mgorny Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/gnome2-utils.eclass,v 1.38 2014/11/23 21:46:29 mgorny Exp $
4 4
5# @ECLASS: gnome2-utils.eclass 5# @ECLASS: gnome2-utils.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# gnome@gentoo.org 7# gnome@gentoo.org
8# @BLURB: Auxiliary functions commonly used by Gnome packages. 8# @BLURB: Auxiliary functions commonly used by Gnome packages.
437 cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" && 437 cp -f "${tmp_file}" "${EROOT}usr/$(get_libdir)/gdk-pixbuf-2.0/2.10.0/loaders.cache" &&
438 rm "${tmp_file}" # don't replace this with mv, required for SELinux support 438 rm "${tmp_file}" # don't replace this with mv, required for SELinux support
439 eend $? 439 eend $?
440} 440}
441 441
442
443# @FUNCTION: gnome2_query_immodules_gtk2 442# @FUNCTION: gnome2_query_immodules_gtk2
444# @USAGE: gnome2_query_immodules_gtk2 443# @USAGE: gnome2_query_immodules_gtk2
445# @DESCRIPTION: 444# @DESCRIPTION:
446# Updates gtk2 immodules/gdk-pixbuf loaders listing. 445# Updates gtk2 immodules/gdk-pixbuf loaders listing.
447gnome2_query_immodules_gtk2() { 446gnome2_query_immodules_gtk2() {
448 if has_version ">=x11-libs/gtk+-2.24.20:2"; then
449 "${EPREFIX}/usr/bin/gtk-query-immodules-2.0" --update-cache
450 else
451 local GTK2_CONFDIR="/etc/gtk-2.0/$(get_abi_CHOST)"
452
453 local query_exec="${EPREFIX}/usr/bin/gtk-query-immodules-2.0" 447 local updater=${EPREFIX}/usr/bin/${CHOST}-gtk-query-immodules-2.0
454 local gtk_conf="${EPREFIX}${GTK2_CONFDIR}/gtk.immodules" 448 [[ ! -x ${updater} ]] && updater=${EPREFIX}/usr/bin/gtk-query-immodules-2.0
455 local gtk_conf_dir=$(dirname "${gtk_conf}")
456 449
457 einfo "Generating Gtk2 immodules/gdk-pixbuf loaders listing:" 450 "${updater}" --update-cache
458 einfo "-> ${gtk_conf}"
459
460 mkdir -p "${gtk_conf_dir}"
461 local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules)
462 if [ -z "${tmp_file}" ]; then
463 ewarn "gtk_query_immodules: cannot create temporary file"
464 return 1
465 fi
466
467 if ${query_exec} > "${tmp_file}"; then
468 cat "${tmp_file}" > "${gtk_conf}" || \
469 ewarn "Failed to write to ${gtk_conf}"
470 else
471 ewarn "Cannot update gtk.immodules, file generation failed"
472 fi
473 rm "${tmp_file}"
474 fi
475} 451}
476 452
477# @FUNCTION: gnome2_query_immodules_gtk3 453# @FUNCTION: gnome2_query_immodules_gtk3
478# @USAGE: gnome2_query_immodules_gtk3 454# @USAGE: gnome2_query_immodules_gtk3
479# @DESCRIPTION: 455# @DESCRIPTION:

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.38

  ViewVC Help
Powered by ViewVC 1.1.20