Update triggers to use passed args, use /bin/sh -e.

Bump xbps-base-files to 0.30.

--HG--
extra : convert_revision : 6158c0bed798e097ba75c902a0be2498e3361e02
This commit is contained in:
Juan RP 2009-12-11 07:23:49 +01:00
parent 934de7606f
commit af1b82c40a
13 changed files with 159 additions and 86 deletions

View File

@ -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 <xtraeme@gmail.com>"

View File

@ -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

View File

@ -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..."

View File

@ -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..."

View File

@ -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... "
;;

View File

@ -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

View File

@ -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..."

View File

@ -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"

View File

@ -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..."

View File

@ -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

View File

@ -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..."

View File

@ -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..."

View File

@ -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
;;