diff --git a/templates/helpers/update-mimedb.sh b/templates/helpers/update-mimedb.sh deleted file mode 100644 index 19ac7cbe40f..00000000000 --- a/templates/helpers/update-mimedb.sh +++ /dev/null @@ -1,13 +0,0 @@ -# -# This helper updates shared-mime-info's database when a template -# requests this operation. -# -updatemimedb_cmd="$XBPS_MASTERDIR/bin/update-mime-database" -updatemimedb_dir="$XBPS_MASTERDIR/share/mime" - -if [ -d "$XBPS_MASTERDIR/share/mime" ]; then - $updatemimedb_cmd $updatemimedb_dir >/dev/null && \ - echo "=> Updated shared-mime-info database." -fi - -unset updatemimedb_cmd updatemimedb_dir diff --git a/templates/xbps-base-files/template b/templates/xbps-base-files/template index 06f3ecef7d5..2f428183177 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.9 +version=0.10 build_style=custom-install short_desc="xbps base system files" maintainer="Juan RP " diff --git a/triggers/mimedb b/triggers/mimedb new file mode 100755 index 00000000000..ea89d6e24e9 --- /dev/null +++ b/triggers/mimedb @@ -0,0 +1,34 @@ +#!/bin/sh +# +# 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 +# +trigger="mimedb" +mimedb_bin=./usr/bin/update-mime-database + +case "$1" in +targets) + echo "post-install post-remove" + ;; +run) + echo "Running $trigger trigger..." + + case "$2" in + post-*) + if [ -x ${mimedb_bin} ]; then + echo "Updating shared-mime-info database..." + ${mimedb_bin} ./usr/share/mime > /dev/null + fi + ;; + esac + ;; +*) + exit 1 + ;; +esac + +exit 0