From f446cf5b2b923150a099e65068ac15d0ca2a7e3d Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 23 Oct 2010 17:49:36 +0200 Subject: [PATCH] xbps-triggers: update to 0.2. Update gtk-pixbuf-loaders trigger for the new gdk-pixbuf package. --- srcpkgs/xbps-triggers/INSTALL | 26 -------------------------- srcpkgs/xbps-triggers/template | 2 +- xbps-src/triggers/gtk-pixbuf-loaders | 16 ++++++++++------ 3 files changed, 11 insertions(+), 33 deletions(-) delete mode 100644 srcpkgs/xbps-triggers/INSTALL diff --git a/srcpkgs/xbps-triggers/INSTALL b/srcpkgs/xbps-triggers/INSTALL deleted file mode 100644 index e4d777103fa..00000000000 --- a/srcpkgs/xbps-triggers/INSTALL +++ /dev/null @@ -1,26 +0,0 @@ -# -case "${ACTION}" in -pre) - # - # xbps-base-files 0.37 does not have the XBPS triggers anymore. - # If installed package is less than 0.37 remove them before - # upgrading the package. - # - if command -v xbps-uhelper.static 2>&1 >/dev/null; then - uhelper="$(command -v xbps-uhelper.static)" - elif command -v xbps-uhelper 2>&1 >/dev/null; then - uhelper="$(command -v xbps-uhelper)" - else - exit 0 - fi - - set +e - ${uhelper} cmpver $(${uhelper} version xbps-base-files) 0.37 - if [ $? -eq 255 ]; then - echo -n "Removing XBPS trigger files, now owned by the " - echo "xbps-triggers package..." - rm -vf var/db/xbps/triggers/* - fi - set -e - ;; -esac diff --git a/srcpkgs/xbps-triggers/template b/srcpkgs/xbps-triggers/template index c199883c506..f88e157eb3e 100644 --- a/srcpkgs/xbps-triggers/template +++ b/srcpkgs/xbps-triggers/template @@ -1,6 +1,6 @@ # Template file for 'xbps-triggers' pkgname=xbps-triggers -version=0.1 +version=0.2 build_style=custom-install short_desc="XBPS Package System triggers" maintainer="Juan RP " diff --git a/xbps-src/triggers/gtk-pixbuf-loaders b/xbps-src/triggers/gtk-pixbuf-loaders index 441aa20aab2..7c2327a4159 100755 --- a/xbps-src/triggers/gtk-pixbuf-loaders +++ b/xbps-src/triggers/gtk-pixbuf-loaders @@ -1,6 +1,6 @@ #!/bin/sh -e # -# Updates GTK+ gdk pixbuf modules file with gdk-pixbuf-query-loaders(1). +# Updates's GDK Pixbuf loaders cache with gdk-pixbuf-query-loaders(1). # # Arguments: $ACTION = [run/targets] # $TARGET = [post-install/post-remove] @@ -15,22 +15,26 @@ VERSION="$4" UPDATE="$5" pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders -pixbuf_loaders=etc/gtk-2.0/gdk-pixbuf.loaders case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then - [ -f ${pixbuf_loaders} ] && rm -f ${pixbuf_loaders} + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gdk-pixbuf" ]; then + _cache_file=$(${pixbuf_bin} --print-cache-file) + [ -f .${_cache_file} ] && rm -f .${_cache_file} break fi case "$TARGET" in post-*) + if [ -f etc/gtk-2.0/gdk-pixbuf.loaders ]; then + echo " Removing obsolete conf file: etc/gtk-2.0/gdk-pixbuf.loaders" + rm -f etc/gtk-2.0/gdk-pixbuf.loaders + fi if [ -x ${pixbuf_bin} ]; then - echo "Updating GTK's pixbuf modules file..." - ${pixbuf_bin} > ${pixbuf_loaders} + echo "Updating GDK Pixbuf loaders cache..." + ${pixbuf_bin} --update-cache fi ;; esac