xbps-triggers: rework some triggers

This lists changes per-trigger, triggers that changed the same thing
are listed under the same group

appstream-cache:
gconf-schemas:
gdk-pixbuf-loaders:
gsettings-schemas:
kernel-hooks:
mkdirs:
pango-modules:
register-shell:
update-dektopdb:
update-desktopdb:
x11-fonts:

- remove useless PATH expansion that is already done in the hook script.

gtk-icon-cache:
gtk-immodules:
gtk3-immodules:

- remove useless PATH expansion that is already done in the hook script.
- use exit 0 instead of break

hwdb.d:

- check if tooling is available

info-files

- Remove support for using host tooling

mimedb:

- remove useless PATH expansion that is already done in the hook script.
- check if tooling is available

xml-catalog:

- remove useless PATH expansion that is already done in the hook script.
- add a xmlcatmgr variable so that the first check not always fails

[ci skip]
This commit is contained in:
maxice8 2018-09-26 17:50:51 -03:00 committed by maxice8
parent f3d9817321
commit 2aef1b2991
19 changed files with 47 additions and 58 deletions

View file

@ -15,8 +15,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
# The appstreamcli binary program. # The appstreamcli binary program.
APPSTREAMCLI="usr/bin/appstreamcli" APPSTREAMCLI="usr/bin/appstreamcli"

View file

@ -24,8 +24,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
# The gconftool-2 binary program. # The gconftool-2 binary program.
GCONFTOOL2="usr/bin/gconftool-2" GCONFTOOL2="usr/bin/gconftool-2"

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders pixbuf_bin=usr/bin/gdk-pixbuf-query-loaders
pixbuf_cache=usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache pixbuf_cache=usr/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
gioquery=usr/bin/gio-querymodules gioquery=usr/bin/gio-querymodules
giocachedir=usr/lib/gio/modules giocachedir=usr/lib/gio/modules

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
# The glib-compile-schemas binary program. # The glib-compile-schemas binary program.
GSCHEMASCOMP="usr/bin/glib-compile-schemas" GSCHEMASCOMP="usr/bin/glib-compile-schemas"

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
iconcache_bin=usr/bin/gtk-update-icon-cache iconcache_bin=usr/bin/gtk-update-icon-cache
case "$ACTION" in case "$ACTION" in
@ -31,10 +29,10 @@ run)
echo "cache for ${dir}." echo "cache for ${dir}."
fi fi
done done
break exit 0
fi fi
if [ ! -x ${iconcache_bin} ]; then if [ ! -x $iconcache_bin ]; then
exit 0 exit 0
fi fi

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
immodules_bin=usr/bin/gtk-query-immodules-2.0 immodules_bin=usr/bin/gtk-query-immodules-2.0
immodules_cache=usr/lib/gtk-2.0/2.10.0/immodules.cache immodules_cache=usr/lib/gtk-2.0/2.10.0/immodules.cache
@ -26,7 +24,7 @@ targets)
run) run)
if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+" ]; then
[ -f ${immodules_cache} ] && rm -f ${immodules_cache} [ -f ${immodules_cache} ] && rm -f ${immodules_cache}
break exit 0
fi fi
case "$TARGET" in case "$TARGET" in
post-*) post-*)
@ -34,10 +32,13 @@ run)
echo "Removing obsolete conf file: etc/gtk-2.0/gtk.immodules" echo "Removing obsolete conf file: etc/gtk-2.0/gtk.immodules"
rm -f etc/gtk-2.0/gtk.immodules rm -f etc/gtk-2.0/gtk.immodules
fi fi
if [ -x ${immodules_bin} ]; then
echo "Updating GTK+ immodules cache..." if [ ! -x $immodules_bin ]; then
${immodules_bin} --update-cache exit 0
fi fi
echo "Updating GTK+ immodules cache..."
$immodules_bin --update-cache
;; ;;
esac esac
;; ;;

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
immodules_bin=usr/bin/gtk-query-immodules-3.0 immodules_bin=usr/bin/gtk-query-immodules-3.0
immodules_cache=usr/lib/gtk-3.0/3.0.0/immodules.cache immodules_cache=usr/lib/gtk-3.0/3.0.0/immodules.cache
@ -26,7 +24,7 @@ targets)
run) run)
if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+3" ]; then if [ "$TARGET" = "post-remove" -a "${PKGNAME}" = "gtk+3" ]; then
[ -f ${immodules_cache} ] && rm -f ${immodules_cache} [ -f ${immodules_cache} ] && rm -f ${immodules_cache}
break exit 0
fi fi
case "$TARGET" in case "$TARGET" in
post-*) post-*)
@ -34,10 +32,13 @@ run)
echo "Removing obsolete conf file: etc/gtk-3.0/gtk.immodules" echo "Removing obsolete conf file: etc/gtk-3.0/gtk.immodules"
rm -f etc/gtk-3.0/gtk.immodules rm -f etc/gtk-3.0/gtk.immodules
fi fi
if [ -x ${immodules_bin} ]; then
echo "Updating GTK+3 immodules cache..." if [ ! -x $immodules_bin ]; then
${immodules_bin} --update-cache exit 0
fi fi
echo "Updating GTK+3 immodules cache..."
$immodules_bin --update-cache
;; ;;
esac esac
;; ;;

View file

@ -14,12 +14,19 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
udevadm=usr/bin/udevadm
case "$ACTION" in case "$ACTION" in
targets) targets)
echo "post-install pre-remove" echo "post-install pre-remove"
;; ;;
run) run)
usr/bin/udevadm hwdb --root=. --update if [ ! -x $udevadm ]; then
exit 0
fi
echo "Updating udev hardware database ..."
$udevadm hwdb --root=. --update
;; ;;
*) *)
exit 1 exit 1

View file

@ -29,8 +29,6 @@ run)
exit 1 exit 1
fi fi
HOSTARCH=$(uname -m)
for f in ${info_files}; do for f in ${info_files}; do
if [ "$f" = "/usr/share/info/dir" ]; then if [ "$f" = "/usr/share/info/dir" ]; then
continue continue
@ -49,10 +47,6 @@ run)
;; ;;
esac esac
if [ "$XBPS_TARGET_ARCH" != "$HOST_ARCH" ]; then
# Use host utility
installinfo=install-info
fi
$installinfo $infoargs ./$f $infodir/dir 2>/dev/null $installinfo $infoargs ./$f $infodir/dir 2>/dev/null
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "done." echo "done."

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
RUN_TARGETS="pre-install post-install pre-remove post-remove" RUN_TARGETS="pre-install post-install pre-remove post-remove"
case "$ACTION" in case "$ACTION" in

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
mimedb_bin=usr/bin/update-mime-database mimedb_bin=usr/bin/update-mime-database
case "$ACTION" in case "$ACTION" in
@ -25,10 +23,12 @@ targets)
run) run)
case "$TARGET" in case "$TARGET" in
post-*) post-*)
if [ -x ${mimedb_bin} ]; then if [ ! -x ${mimedb_bin} ]; then
exit 0
fi
echo "Updating shared-mime-info database..." echo "Updating shared-mime-info database..."
PKGSYSTEM_ENABLE_FSYNC=0 ${mimedb_bin} -n usr/share/mime > /dev/null PKGSYSTEM_ENABLE_FSYNC=0 ${mimedb_bin} -n usr/share/mime > /dev/null
fi
;; ;;
esac esac
;; ;;

View file

@ -18,8 +18,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
case "$ACTION" in case "$ACTION" in
targets) targets)
echo "post-install post-remove" echo "post-install post-remove"

View file

@ -20,8 +20,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
pango_modules=etc/pango/pango.modules pango_modules=etc/pango/pango.modules
case "$ACTION" in case "$ACTION" in

View file

@ -14,8 +14,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
case "$ACTION" in case "$ACTION" in
targets) targets)
echo "post-install post-remove" echo "post-install post-remove"

View file

@ -26,11 +26,15 @@ targets)
run) run)
if [ "$TARGET" = "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} [ -f ${desktopdb_cache} ] && rm -f ${desktopdb_cache}
break exit 0
fi fi
case "$TARGET" in case "$TARGET" in
post-*) post-*)
if [ -x ${desktopdb_bin} -a -d $desktopdb_dir ]; then if [ ! -x $desktopdb_bin ]; then
exit 0
fi
if [ -d $desktopdb_dir ]; then
echo "Updating MIME database..." echo "Updating MIME database..."
${desktopdb_bin} ${desktopdb_dir} ${desktopdb_bin} ${desktopdb_dir}
fi fi

View file

@ -16,8 +16,6 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
mkfontdir=usr/bin/mkfontdir mkfontdir=usr/bin/mkfontdir
mkfontscale=usr/bin/mkfontscale mkfontscale=usr/bin/mkfontscale
fccache=usr/bin/fc-cache fccache=usr/bin/fc-cache
@ -27,7 +25,11 @@ targets)
echo "post-install post-remove" echo "post-install post-remove"
;; ;;
run) run)
if [ ! -x ${mkfontdir} -a ! -x ${mkfontscale} ]; then if [ ! -x $mkfontdir ]; then
exit 0
fi
if [ ! -x $mkfontscale ]; then
exit 0 exit 0
fi fi

View file

@ -15,18 +15,18 @@ PKGNAME="$3"
VERSION="$4" VERSION="$4"
UPDATE="$5" UPDATE="$5"
export PATH="$PATH:/usr/local/bin"
sgml_catalog=usr/share/sgml/catalog sgml_catalog=usr/share/sgml/catalog
xml_catalog=usr/share/xml/catalog xml_catalog=usr/share/xml/catalog
xmlcatmgr=usr/bin/xmlcatmgr
register_entries() register_entries()
{ {
if [ -n "${sgml_entries}" ]; then if [ -n "${sgml_entries}" ]; then
echo -n "Registering SGML catalog entries... " echo -n "Registering SGML catalog entries... "
set -- ${sgml_entries} set -- ${sgml_entries}
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
xmlcatmgr -sc ${sgml_catalog} add "$1" "$2" "$3" $xmlcatmgr -sc ${sgml_catalog} add "$1" "$2" "$3"
shift; shift; shift; shift; shift; shift;
done done
echo "done." echo "done."
@ -36,7 +36,7 @@ register_entries()
echo -n "Registering XML catalog entries... " echo -n "Registering XML catalog entries... "
set -- ${xml_entries} set -- ${xml_entries}
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
xmlcatmgr -c ${xml_catalog} add "$1" "$2" "$3" $xmlcatmgr -c ${xml_catalog} add "$1" "$2" "$3"
shift; shift; shift; shift; shift; shift;
done done
echo "done." echo "done."
@ -49,7 +49,7 @@ unregister_entries()
echo -n "Unregistering SGML catalog entries... " echo -n "Unregistering SGML catalog entries... "
set -- ${sgml_entries} set -- ${sgml_entries}
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
xmlcatmgr -sc ${sgml_catalog} remove "$1" "$2" \ $xmlcatmgr -sc ${sgml_catalog} remove "$1" "$2" \
2>/dev/null 2>/dev/null
shift; shift; shift shift; shift; shift
done done
@ -59,7 +59,7 @@ unregister_entries()
echo -n "Unregistering XML catalog entries... " echo -n "Unregistering XML catalog entries... "
set -- ${xml_entries} set -- ${xml_entries}
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
xmlcatmgr -c ${xml_catalog} remove "$1" "$2" \ $xmlcatmgr -c ${xml_catalog} remove "$1" "$2" \
2>/dev/null 2>/dev/null
shift; shift; shift shift; shift; shift
done done

View file

@ -1,6 +1,6 @@
# Template file for 'xbps-triggers' # Template file for 'xbps-triggers'
pkgname=xbps-triggers pkgname=xbps-triggers
version=0.109 version=0.110
revision=1 revision=1
noarch=yes noarch=yes
bootstrap=yes bootstrap=yes