diff options
author | Fabio Erculiani <lxnay@gentoo.org> | 2012-04-25 10:02:24 +0000 |
---|---|---|
committer | Fabio Erculiani <lxnay@gentoo.org> | 2012-04-25 10:02:24 +0000 |
commit | 40a1b935601a69c6889dcc48944a9aa4fc6ddd2f (patch) | |
tree | 20b9080df3d8a35c0620e937f01a7c59539f3362 /app-emulation/emul-linux-x86-gtklibs | |
parent | simplify pango-querymodules usage (diff) | |
download | gentoo-2-40a1b935601a69c6889dcc48944a9aa4fc6ddd2f.tar.gz gentoo-2-40a1b935601a69c6889dcc48944a9aa4fc6ddd2f.tar.bz2 gentoo-2-40a1b935601a69c6889dcc48944a9aa4fc6ddd2f.zip |
fix gtk/pango/gdk-pixbuf query tools usage, be atomic, be POSIX
(Portage version: 2.2.0_alpha84/cvs/Linux x86_64, RepoMan options: --force)
Diffstat (limited to 'app-emulation/emul-linux-x86-gtklibs')
3 files changed, 82 insertions, 49 deletions
diff --git a/app-emulation/emul-linux-x86-gtklibs/ChangeLog b/app-emulation/emul-linux-x86-gtklibs/ChangeLog index b09a16809838..66ca1a8c4a81 100644 --- a/app-emulation/emul-linux-x86-gtklibs/ChangeLog +++ b/app-emulation/emul-linux-x86-gtklibs/ChangeLog @@ -1,6 +1,11 @@ # ChangeLog for app-emulation/emul-linux-x86-gtklibs # Copyright 1999-2012 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/ChangeLog,v 1.100 2012/04/25 09:38:01 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/ChangeLog,v 1.101 2012/04/25 10:02:24 lxnay Exp $ + + 25 Apr 2012; Fabio Erculiani <lxnay@gentoo.org> + emul-linux-x86-gtklibs-20110928.ebuild, + emul-linux-x86-gtklibs-20120127.ebuild: + fix gtk/pango/gdk-pixbuf query tools usage, be atomic, be POSIX 25 Apr 2012; Fabio Erculiani <lxnay@gentoo.org> emul-linux-x86-gtklibs-20110928.ebuild, diff --git a/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild b/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild index dc8f7145a845..f41678a1c5fd 100644 --- a/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild +++ b/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild,v 1.9 2012/04/25 09:38:01 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20110928.ebuild,v 1.10 2012/04/25 10:02:24 lxnay Exp $ EAPI="4" @@ -19,8 +19,8 @@ my_gdk_pixbuf_query_loaders() { # causes segfault if set unset __GL_NO_DSO_FINALIZER - tmp_file=$(mktemp --suffix=gdk_pixbuf_ebuild) - # be atomic! + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgdk_pixbuf_query_loaders) + if gdk-pixbuf-query-loaders32 > "${tmp_file}"; then cat "${tmp_file}" > "${ROOT}usr/lib32/gdk-pixbuf-2.0/2.10.0/loaders.cache" else @@ -29,6 +29,38 @@ my_gdk_pixbuf_query_loaders() { rm "${tmp_file}" } +my_pango_querymodules() { + PANGO_CONFDIR="/etc/pango/i686-pc-linux-gnu" + einfo "Generating pango modules listing..." + + mkdir -p "${PANGO_CONFDIR}" + local pango_conf="${PANGO_CONFDIR}/pango.modules" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXpango_querymodules) + + if pango-querymodules32 > "${tmp_file}"; then + cat "${tmp_file}" > "${pango_conf}" + else + ewarn "Cannot update pango.modules, file generation failed" + fi + rm "${tmp_file}" +} + +my_gtk_query_immodules() { + GTK2_CONFDIR="/etc/gtk-2.0/i686-pc-linux-gnu" + einfo "Generating gtk+ immodules/gdk-pixbuf loaders listing..." + + mkdir -p "${GTK2_CONFDIR}" + local gtk_conf="${ROOT}${GTK2_CONFDIR}/gtk.immodules" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules) + + if gtk-query-immodules-2.0-32 > "${tmp_file}"; then + cat "${tmp_file}" > "${gtk_conf}" + else + ewarn "Cannot update gtk.immodules, file generation failed" + fi + rm "${tmp_file}" +} + src_prepare() { query_tools="${S}/usr/bin/gtk-query-immodules-2.0|${S}/usr/bin/gdk-pixbuf-query-loaders|${S}/usr/bin/pango-querymodules" ALLOWED="(${S}/etc/env.d|${S}/etc/gtk-2.0|${S}/etc/pango/i686-pc-linux-gnu|${query_tools})" @@ -48,30 +80,12 @@ pkg_preinst() { } pkg_postinst() { - PANGO_CONFDIR="/etc/pango/i686-pc-linux-gnu" - einfo "Generating pango modules listing..." - - mkdir -p "${PANGO_CONFDIR}" - local pango_conf="${PANGO_CONFDIR}/pango.modules" - local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgdk_pixbuf_ebuild) - - # be atomic! - pango-querymodules32 > "${tmp_file}" - if [ "${?}" = "0" ]; then - cat "${tmp_file}" > "${pango_conf}" || die - else - ewarn "Cannot update pango.modules, file generation failed" - fi - rm "${tmp_file}" - - GTK2_CONFDIR="/etc/gtk-2.0/i686-pc-linux-gnu" - einfo "Generating gtk+ immodules/gdk-pixbuf loaders listing..." - mkdir -p ${GTK2_CONFDIR} - gtk-query-immodules-2.0-32 > "${ROOT}${GTK2_CONFDIR}/gtk.immodules" + my_pango_querymodules + my_gtk_query_immodules my_gdk_pixbuf_query_loaders # gdk-pixbuf.loaders should be in their CHOST directories respectively. - if [[ -e ${ROOT}/etc/gtk-2.0/gdk-pixbuf.loaders ]] ; then + if [[ -e "${ROOT}/etc/gtk-2.0/gdk-pixbuf.loaders" ]] ; then ewarn ewarn "File /etc/gtk-2.0/gdk-pixbuf.loaders shouldn't be present on" ewarn "multilib systems, please remove it by hand." diff --git a/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild b/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild index e54cf937565e..41868d08db30 100644 --- a/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild +++ b/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild,v 1.7 2012/04/25 09:38:01 lxnay Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-emulation/emul-linux-x86-gtklibs/emul-linux-x86-gtklibs-20120127.ebuild,v 1.8 2012/04/25 10:02:24 lxnay Exp $ EAPI="4" @@ -19,8 +19,8 @@ my_gdk_pixbuf_query_loaders() { # causes segfault if set unset __GL_NO_DSO_FINALIZER - tmp_file=$(mktemp --suffix=gdk_pixbuf_ebuild) - # be atomic! + local tmp_file=$(mktemp --suffix=tmp.XXXXXXXXXXgdk_pixbuf_queryloaders) + if gdk-pixbuf-query-loaders32 > "${tmp_file}"; then cat "${tmp_file}" > "${ROOT}usr/lib32/gdk-pixbuf-2.0/2.10.0/loaders.cache" else @@ -29,6 +29,38 @@ my_gdk_pixbuf_query_loaders() { rm "${tmp_file}" } +my_pango_querymodules() { + PANGO_CONFDIR="/etc/pango/i686-pc-linux-gnu" + einfo "Generating pango modules listing..." + + mkdir -p "${PANGO_CONFDIR}" + local pango_conf="${PANGO_CONFDIR}/pango.modules" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXpango_querymodules) + + if pango-querymodules32 > "${tmp_file}"; then + cat "${tmp_file}" > "${pango_conf}" + else + ewarn "Cannot update pango.modules, file generation failed" + fi + rm "${tmp_file}" +} + +my_gtk_query_immodules() { + GTK2_CONFDIR="/etc/gtk-2.0/i686-pc-linux-gnu" + einfo "Generating gtk+ immodules/gdk-pixbuf loaders listing..." + + mkdir -p "${GTK2_CONFDIR}" + local gtk_conf="${ROOT}${GTK2_CONFDIR}/gtk.immodules" + local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgtk_query_immodules) + + if gtk-query-immodules-2.0-32 > "${tmp_file}"; then + cat "${tmp_file}" > "${gtk_conf}" + else + ewarn "Cannot update gtk.immodules, file generation failed" + fi + rm "${tmp_file}" +} + src_prepare() { query_tools="${S}/usr/bin/gtk-query-immodules-2.0|${S}/usr/bin/gdk-pixbuf-query-loaders|${S}/usr/bin/pango-querymodules" ALLOWED="(${S}/etc/env.d|${S}/etc/gtk-2.0|${S}/etc/pango/i686-pc-linux-gnu|${query_tools})" @@ -48,30 +80,12 @@ pkg_preinst() { } pkg_postinst() { - PANGO_CONFDIR="/etc/pango/i686-pc-linux-gnu" - einfo "Generating pango modules listing..." - - mkdir -p "${PANGO_CONFDIR}" - local pango_conf="${PANGO_CONFDIR}/pango.modules" - local tmp_file=$(mktemp -t tmp.XXXXXXXXXXgdk_pixbuf_ebuild) - - # be atomic! - pango-querymodules32 > "${tmp_file}" - if [ "${?}" = "0" ]; then - cat "${tmp_file}" > "${pango_conf}" || die - else - ewarn "Cannot update pango.modules, file generation failed" - fi - rm "${tmp_file}" - - GTK2_CONFDIR="/etc/gtk-2.0/i686-pc-linux-gnu" - einfo "Generating gtk+ immodules/gdk-pixbuf loaders listing..." - mkdir -p ${GTK2_CONFDIR} - gtk-query-immodules-2.0-32 > "${ROOT}${GTK2_CONFDIR}/gtk.immodules" + my_pango_querymodules + my_gtk_query_immodules my_gdk_pixbuf_query_loaders # gdk-pixbuf.loaders should be in their CHOST directories respectively. - if [[ -e ${ROOT}/etc/gtk-2.0/gdk-pixbuf.loaders ]] ; then + if [[ -e "${ROOT}/etc/gtk-2.0/gdk-pixbuf.loaders" ]] ; then ewarn ewarn "File /etc/gtk-2.0/gdk-pixbuf.loaders shouldn't be present on" ewarn "multilib systems, please remove it by hand." |