# HG changeset patch # User Antoine Bodin # Date 1280874669 -7200 # Node ID 761a811e1f07da8d0316235099d6a541c7d97a49 # Parent a911173f3018994e4e6e287ca4ff4c71227f2ca8 Add: Automatic update-desktop-database diff -r a911173f3018 -r 761a811e1f07 tazpkg --- a/tazpkg Tue Aug 03 23:27:35 2010 +0200 +++ b/tazpkg Wed Aug 04 00:31:09 2010 +0200 @@ -557,6 +557,10 @@ if grep -q ^post_install $ROOT$INSTALLED/$PACKAGE/receipt; then post_install $ROOT fi + # Update-desktop-database if needed. + if [ "$(grep .desktop $ROOT$INSTALLED/$PACKAGE/files.list | grep /usr/share/applications/)" ]; then + updatedesktopdb=yes + fi cd $TOP_DIR echo "================================================================================" eval_gettext "\$PACKAGE (\$VERSION\$EXTRAVERSION) is installed."; echo @@ -1292,6 +1296,13 @@ rm -rf $TMP_DIR } +update_desktop_database() +{ + if [ -f /usr/bin/update-desktop-database ] && [ -n "$updatedesktopdb" ]; then + update-desktop-database + fi +} + ################### # Tazpkg commands # ################### @@ -1642,7 +1653,8 @@ if [ "$DO_CHECK" = "yes" ]; then check_for_installed_package $ROOT fi - install_package $ROOT ;; + install_package $ROOT + update_desktop_database ;; install-list|get-install-list) # Install a set of packages from a list. # @@ -2500,7 +2512,8 @@ fi PACKAGE_FILE=$CACHE_DIR/$PACKAGE.tazpkg install_package $ROOT - [ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT ;; + [ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT + update_desktop_database;; clean-cache) # Remove all downloaded packages. #