From bbb89a8be28953054d58cb40b566de2645cb9ef4 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 18 Apr 2009 15:07:51 +0200 Subject: [PATCH] xbps-base-files: add three new triggers for gtk+. Bump to 0.11. --HG-- extra : convert_revision : cd0a71d2b032dd56da02516d2befa00bc4d026f9 --- .../helpers/gtk-update-gdkpixbufloaders.sh | 17 --------- templates/helpers/gtk-update-icon-cache.sh | 14 ------- templates/helpers/gtk-update-immodules.sh | 17 --------- templates/xbps-base-files/template | 2 +- triggers/gtk-icon-cache | 35 +++++++++++++++++ triggers/gtk-immodules | 38 +++++++++++++++++++ triggers/gtk-pixbuf-loaders | 38 +++++++++++++++++++ 7 files changed, 112 insertions(+), 49 deletions(-) delete mode 100644 templates/helpers/gtk-update-gdkpixbufloaders.sh delete mode 100644 templates/helpers/gtk-update-icon-cache.sh delete mode 100644 templates/helpers/gtk-update-immodules.sh create mode 100644 triggers/gtk-icon-cache create mode 100644 triggers/gtk-immodules create mode 100644 triggers/gtk-pixbuf-loaders diff --git a/templates/helpers/gtk-update-gdkpixbufloaders.sh b/templates/helpers/gtk-update-gdkpixbufloaders.sh deleted file mode 100644 index 5545b4ccdbe..00000000000 --- a/templates/helpers/gtk-update-gdkpixbufloaders.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# This helper updates GTK's gdk-pixbug.loaders modules file every time -# a template requests this process. -# -gtk_version="2.0" -gdk_pixbuf_query_cmd=$XBPS_MASTERDIR/bin/gdk-pixbuf-query-loaders -gdk_pixbuf_db=$XBPS_SYSCONFDIR/gtk-$gtk_version/gdk-pixbuf.loaders - -if [ -x $gdk_pixbuf_query_cmd -a -w $gdk_pixbuf_db ]; then - $gdk_pixbuf_query_cmd > $gdk_pixbuf_db - [ "$?" -eq 0 ] && \ - echo "=> Updated GTK+ $(basename $gdk_pixbuf_db) modules file." -fi - -unset gtk_version -unset gdk_pixbuf_query_cmd -unset gdk_pixbuf_dbfile diff --git a/templates/helpers/gtk-update-icon-cache.sh b/templates/helpers/gtk-update-icon-cache.sh deleted file mode 100644 index ba421daf794..00000000000 --- a/templates/helpers/gtk-update-icon-cache.sh +++ /dev/null @@ -1,14 +0,0 @@ -# -# This helper updates the GTK's theme icon cache as requested by -# any template. -# - -gtkupdate_iconcache_cmd=$XBPS_MASTERDIR/bin/gtk-update-icon-cache -iconcache_theme_dir=$XBPS_MASTERDIR/share/icons/hicolor - -if [ -x $gtkupdate_iconcache_cmd -a -d $iconcache_theme_dir ]; then - $gtkupdate_iconcache_cmd -f -t $iconcache_theme_dir && \ - echo "=> Updated GTK's hicolor icon cache theme." -fi - -unset gtkupdate_iconcache_cmd iconcache_theme_dir diff --git a/templates/helpers/gtk-update-immodules.sh b/templates/helpers/gtk-update-immodules.sh deleted file mode 100644 index 900bc404e54..00000000000 --- a/templates/helpers/gtk-update-immodules.sh +++ /dev/null @@ -1,17 +0,0 @@ -# -# This helper updates GTK's gtk.immodules modules file every time -# a template requests this process. -# -gtk_version="2.0" -gtk_query_immodules_cmd=$XBPS_MASTERDIR/bin/gtk-query-immodules-$gtk_version -gtk_immodules_db=$XBPS_SYSCONFDIR/gtk-$gtk_version/gtk.immodules - -if [ -x $gtk_query_immodules_cmd -a -w $gtk_immodules_db ]; then - $gtk_query_immodules_cmd > $gtk_immodules_db - [ "$?" -eq 0 ] && \ - echo "=> Updated GTK+ $(basename $gtk_immodules_db) modules file." -fi - -unset gtk_version -unset gtk_query_immodules_cmd -unset gtk_immodules_db diff --git a/templates/xbps-base-files/template b/templates/xbps-base-files/template index 2f428183177..e58ddc3374d 100644 --- a/templates/xbps-base-files/template +++ b/templates/xbps-base-files/template @@ -1,6 +1,6 @@ # Template file for 'xbps-base-files' pkgname=xbps-base-files -version=0.10 +version=0.11 build_style=custom-install short_desc="xbps base system files" maintainer="Juan RP " diff --git a/triggers/gtk-icon-cache b/triggers/gtk-icon-cache new file mode 100644 index 00000000000..9fdc828cf13 --- /dev/null +++ b/triggers/gtk-icon-cache @@ -0,0 +1,35 @@ +#!/bin/sh +# +# Updates GTK+ icon cache file with gtk-update-icon-cache(1). +# +# Arguments: $1 = action [run/targets] +# $2 = target [post-install/post-remove] +# $3 = pkgname +# $4 = version +# +trigger="gtk-icon-cache" +iconcache_bin=./usr/bin/gtk-update-icon-cache +iconcache_dir=./usr/share/icons/hicolor + +case "$1" in +targets) + echo "post-install post-remove" + ;; +run) + echo "Running $trigger trigger..." + + case "$2" in + post-*) + if [ -x ${iconcache_bin} ]; then + echo "Updating GTK's icon cache themes..." + ${iconcache_bin} -f -t ${iconcache_dir} + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/triggers/gtk-immodules b/triggers/gtk-immodules new file mode 100644 index 00000000000..323e67ee1c2 --- /dev/null +++ b/triggers/gtk-immodules @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Updates GTK+ IM modules file with gtk-query-immodules-2.0(1). +# +# Arguments: $1 = action [run/targets] +# $2 = target [post-install/post-remove] +# $3 = pkgname +# $4 = version +# +trigger="gtk-immodules" +immodules_bin=./usr/bin/gtk-query-immodules-2.0 +immodules_db=./etc/gtk-2.0/gtk.immodules + +case "$1" in +targets) + echo "post-install post-remove" + ;; +run) + echo "Running $trigger trigger..." + + case "$2" in + post-*) + if [ -f ${immodules_db} ]; then + rm -f ${immodules_db} + fi + if [ -x ${immodules_bin} ]; then + echo "Updating GTK's immodules database..." + ${immodules_bin} > ${immodules_db} + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0 diff --git a/triggers/gtk-pixbuf-loaders b/triggers/gtk-pixbuf-loaders new file mode 100644 index 00000000000..41903adc7ba --- /dev/null +++ b/triggers/gtk-pixbuf-loaders @@ -0,0 +1,38 @@ +#!/bin/sh +# +# Updates GTK+ gdk pixbuf loaders file with gdk-pixbuf-queryloaders(1). +# +# Arguments: $1 = action [run/targets] +# $2 = target [post-install/post-remove] +# $3 = pkgname +# $4 = version +# +trigger="gtk-pixbuf-loaders" +pixbuf_bin=./usr/bin/gdk-pixbuf-queryloaders +pixbuf_loaders=./etc/gtk-2.0/gdk-pixbuf.loaders + +case "$1" in +targets) + echo "post-install post-remove" + ;; +run) + echo "Running $trigger trigger..." + + case "$2" in + post-*) + if [ -f ${pixbuf_loaders} ]; then + rm -f ${pixbuf_loaders} + fi + if [ -x ${pixbuf_bin} ]; then + echo "Updating GTK's pixbuf loaders database..." + ${pixbuf_bin} > ${pixbuf_loaders} + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0