From af1b82c40ac6c7d658b03081f5f3fb3157f91fdd Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 11 Dec 2009 07:23:49 +0100 Subject: [PATCH] Update triggers to use passed args, use /bin/sh -e. Bump xbps-base-files to 0.30. --HG-- extra : convert_revision : 6158c0bed798e097ba75c902a0be2498e3361e02 --- srcpkgs/xbps-base-files/template | 2 +- xbps-src/triggers/gtk-icon-cache | 23 +++++++++++++++-------- xbps-src/triggers/gtk-immodules | 23 +++++++++++++++-------- xbps-src/triggers/gtk-pixbuf-loaders | 23 +++++++++++++++-------- xbps-src/triggers/info-files | 20 ++++++++++++++------ xbps-src/triggers/initramfs-tools | 12 +++++++----- xbps-src/triggers/mimedb | 21 ++++++++++++++------- xbps-src/triggers/openrc-service | 12 ++++++------ xbps-src/triggers/pango-modules | 23 +++++++++++++++-------- xbps-src/triggers/register-shell | 22 ++++++++++++++-------- xbps-src/triggers/update-desktopdb | 23 +++++++++++++++-------- xbps-src/triggers/x11-fonts | 20 ++++++++++++++------ xbps-src/triggers/xml-catalog | 21 ++++++++++++++------- 13 files changed, 159 insertions(+), 86 deletions(-) diff --git a/srcpkgs/xbps-base-files/template b/srcpkgs/xbps-base-files/template index 9d7edb17280..4eccfaa6e75 100644 --- a/srcpkgs/xbps-base-files/template +++ b/srcpkgs/xbps-base-files/template @@ -1,6 +1,6 @@ # Template file for 'xbps-base-files' pkgname=xbps-base-files -version=0.29 +version=0.30 build_style=custom-install short_desc="xbps base system files" maintainer="Juan RP " diff --git a/xbps-src/triggers/gtk-icon-cache b/xbps-src/triggers/gtk-icon-cache index a2aa6e18e84..679408702ae 100755 --- a/xbps-src/triggers/gtk-icon-cache +++ b/xbps-src/triggers/gtk-icon-cache @@ -1,20 +1,27 @@ -#!/bin/sh +#!/bin/sh -e # # 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 +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + iconcache_bin=usr/bin/gtk-update-icon-cache -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$2" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then for dir in ${gtk_iconcache_dirs}; do if [ -f ${dir}/icon-theme.cache ]; then rm -f ${dir}/icon-theme.cache @@ -24,7 +31,7 @@ run) done break fi - case "$2" in + case "$TARGET" in post-*) for dir in ${gtk_iconcache_dirs}; do if [ -x ${iconcache_bin} ]; then diff --git a/xbps-src/triggers/gtk-immodules b/xbps-src/triggers/gtk-immodules index e1743c4d75a..1f534e83769 100755 --- a/xbps-src/triggers/gtk-immodules +++ b/xbps-src/triggers/gtk-immodules @@ -1,25 +1,32 @@ -#!/bin/sh +#!/bin/sh -e # # 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 +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + immodules_bin=usr/bin/gtk-query-immodules-2.0 immodules_db=etc/gtk-2.0/gtk.immodules -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$2" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then [ -f ${immodules_db} ] rm -f ${immodules_db} break fi - case "$2" in + case "$TARGET" in post-*) if [ -x ${immodules_bin} ]; then echo "Updating GTK's immodules database..." diff --git a/xbps-src/triggers/gtk-pixbuf-loaders b/xbps-src/triggers/gtk-pixbuf-loaders index 5b9f83b8304..441aa20aab2 100755 --- a/xbps-src/triggers/gtk-pixbuf-loaders +++ b/xbps-src/triggers/gtk-pixbuf-loaders @@ -1,25 +1,32 @@ -#!/bin/sh +#!/bin/sh -e # # Updates GTK+ gdk pixbuf modules file with gdk-pixbuf-query-loaders(1). # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/post-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders pixbuf_loaders=etc/gtk-2.0/gdk-pixbuf.loaders -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$2" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then [ -f ${pixbuf_loaders} ] && rm -f ${pixbuf_loaders} break fi - case "$2" in + case "$TARGET" in post-*) if [ -x ${pixbuf_bin} ]; then echo "Updating GTK's pixbuf modules file..." diff --git a/xbps-src/triggers/info-files b/xbps-src/triggers/info-files index 9abfeb4ba69..2a792cb357f 100755 --- a/xbps-src/triggers/info-files +++ b/xbps-src/triggers/info-files @@ -1,15 +1,23 @@ -#!/bin/sh +#!/bin/sh -e # # Registers or unregisters info files for a package. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/pre-remove] -# $3 = pkgname +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + installinfo=usr/bin/install-info infodir=usr/share/info -case "$1" in +case "$ACTION" in targets) echo "post-install pre-remove" ;; @@ -24,7 +32,7 @@ run) for f in ${info_files}; do [ "$f" = "/usr/share/info/dir" ] && continue - case "$2" in + case "$TARGET" in post-install) echo -n "Registering info file: $f... " ;; diff --git a/xbps-src/triggers/initramfs-tools b/xbps-src/triggers/initramfs-tools index 6f6285a7fb1..e9b399dbe07 100755 --- a/xbps-src/triggers/initramfs-tools +++ b/xbps-src/triggers/initramfs-tools @@ -1,18 +1,20 @@ -#!/bin/sh -e +#!/bin/sh -e -e # # Runs update-initramfs(8) to create/update an initramfs for specified # version (if the pkg that is triggering it) or for the currently # installed kernel otherwise. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/post-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # ACTION="$1" TARGET="$2" PKGNAME="$3" VERSION="$4" +UPDATE="$5" update_initramfs=usr/sbin/update-initramfs diff --git a/xbps-src/triggers/mimedb b/xbps-src/triggers/mimedb index 119e861fcb1..a76ca71b9b2 100755 --- a/xbps-src/triggers/mimedb +++ b/xbps-src/triggers/mimedb @@ -1,20 +1,27 @@ -#!/bin/sh +#!/bin/sh -e # # Updates the shared-mime-info db file with update-mime-database(1). # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/post-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + mimedb_bin=usr/bin/update-mime-database -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - case "$2" in + case "$TARGET" in post-*) if [ -x ${mimedb_bin} ]; then echo "Updating shared-mime-info database..." diff --git a/xbps-src/triggers/openrc-service b/xbps-src/triggers/openrc-service index b99a1baec17..256215e31c7 100755 --- a/xbps-src/triggers/openrc-service +++ b/xbps-src/triggers/openrc-service @@ -1,13 +1,13 @@ -#!/bin/sh +#!/bin/sh -e -e # # Registers or unregisters OpenRC services into the specified # runlevel. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/pre-remove] -# $3 = pkgname -# $4 = version -# $5 = update [yes/no] +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # ACTION="$1" TARGET="$2" diff --git a/xbps-src/triggers/pango-modules b/xbps-src/triggers/pango-modules index 691ac31bd51..ab21be33b1a 100755 --- a/xbps-src/triggers/pango-modules +++ b/xbps-src/triggers/pango-modules @@ -1,28 +1,35 @@ -#!/bin/sh +#!/bin/sh -e # # Updates the list of pango modules with pango-querymodules(1). # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/post-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + pango_bin=usr/bin/pango-querymodules pango_modules=etc/pango/pango.modules -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$2" = "post-remove" -a "${PKGNAME}" = "pango" ]; then + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "pango" ]; then if [ -f ${pango_modules} ]; then echo "Removing pango modules file..." rm -f ${pango_modules} fi break fi - case "$2" in + case "$TARGET" in post-*) if [ -x ${pango_bin} ]; then echo "Updating pango modules file..." diff --git a/xbps-src/triggers/register-shell b/xbps-src/triggers/register-shell index 6b1a46783d4..e2cacfab770 100755 --- a/xbps-src/triggers/register-shell +++ b/xbps-src/triggers/register-shell @@ -1,26 +1,32 @@ -#!/bin/sh +#!/bin/sh -e # # Registers or unregisters a shell in /etc/shells. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - [ "$2" != "post-install" -a "$2" != "post-remove" ] && exit 1 + [ "$TARGET" != "post-install" -a "$TARGET" != "post-remove" ] && exit 1 if [ -z "$register_shell" ]; then echo "Trigger register-shell: empty \$register_shell!" exit 1 fi - case "$2" in + case "$TARGET" in post-install) if [ ! -f etc/shells ]; then for f in ${register_shell}; do diff --git a/xbps-src/triggers/update-desktopdb b/xbps-src/triggers/update-desktopdb index 36ccf1bd39b..ea14b9d01b5 100755 --- a/xbps-src/triggers/update-desktopdb +++ b/xbps-src/triggers/update-desktopdb @@ -1,27 +1,34 @@ -#!/bin/sh +#!/bin/sh -e # # Updates the MIME database that connects with applications, through # the update-desktop-database(1) utility. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/post-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/post-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + desktopdb_bin=usr/bin/update-desktop-database desktopdb_dir=usr/share/applications desktopdb_cache=${desktopdb_dir}/mimeinfo.cache -case "$1" in +case "$ACTION" in targets) echo "post-install post-remove" ;; run) - if [ "$2" = "post-remove" -a "${PKGNAME}" = "desktop-file-utils" ]; then + if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "desktop-file-utils" ]; then [ -f ${desktopdb_cache} ] && rm -f ${desktopdb_cache} break fi - case "$2" in + case "$TARGET" in post-*) if [ -x ${desktopdb_bin} ]; then echo "Updating MIME database..." diff --git a/xbps-src/triggers/x11-fonts b/xbps-src/triggers/x11-fonts index ea8946bd1c0..5219631f9ed 100755 --- a/xbps-src/triggers/x11-fonts +++ b/xbps-src/triggers/x11-fonts @@ -1,18 +1,26 @@ -#!/bin/sh +#!/bin/sh -e # # This trigger rebuilds the fonts.dir and fonts.scale files # for packages that install X11 fonts, and update fontconfig's # cache for those fonts. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/pre-remove] -# $3 = pkgname +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + mkfontdir=usr/bin/mkfontdir mkfontscale=usr/bin/mkfontscale fccache=usr/bin/fc-cache -case "$1" in +case "$ACTION" in targets) echo "post-install pre-remove" ;; @@ -23,7 +31,7 @@ run) [ -z "${font_dirs}" ] && exit 0 - case "$2" in + case "$TARGET" in post-install) for dir in ${font_dirs}; do echo "Building ${dir}/fonts.dir..." diff --git a/xbps-src/triggers/xml-catalog b/xbps-src/triggers/xml-catalog index 493b5c10f2a..3a12359f843 100755 --- a/xbps-src/triggers/xml-catalog +++ b/xbps-src/triggers/xml-catalog @@ -1,13 +1,20 @@ -#!/bin/sh +#!/bin/sh -e # # Registers or unregisters SGML/XML catalog entries, through # the xmlcatmgr application. # -# Arguments: $1 = action [run/targets] -# $2 = target [post-install/pre-remove] -# $3 = pkgname -# $4 = version +# Arguments: $ACTION = [run/targets] +# $TARGET = [post-install/pre-remove] +# $PKGNAME +# $VERSION +# $UPDATE = [yes/no] # +ACTION="$1" +TARGET="$2" +PKGNAME="$3" +VERSION="$4" +UPDATE="$5" + sgml_catalog=usr/share/sgml/catalog xml_catalog=usr/share/xml/catalog @@ -58,7 +65,7 @@ unregister_entries() fi } -case "$1" in +case "$ACTION" in targets) echo "post-install pre-remove" ;; @@ -67,7 +74,7 @@ run) [ -n "${sgml_entries}" -a ! -f "${sgml_catalog}" ] && exit 0 [ -n "${xml_entries}" -a ! -f "${xml_catalog}" ] && exit 0 - case "$2" in + case "$TARGET" in post-install) register_entries ;;