tazpkg rev 356
Add: Automatic update-desktop-database
author | Antoine Bodin <gokhlayeh@mailoo.org> |
---|---|
date | Wed Aug 04 00:31:09 2010 +0200 (2010-08-04) |
parents | a911173f3018 |
children | bf56261495e8 |
files | tazpkg |
line diff
1.1 --- a/tazpkg Tue Aug 03 23:27:35 2010 +0200 1.2 +++ b/tazpkg Wed Aug 04 00:31:09 2010 +0200 1.3 @@ -557,6 +557,10 @@ 1.4 if grep -q ^post_install $ROOT$INSTALLED/$PACKAGE/receipt; then 1.5 post_install $ROOT 1.6 fi 1.7 + # Update-desktop-database if needed. 1.8 + if [ "$(grep .desktop $ROOT$INSTALLED/$PACKAGE/files.list | grep /usr/share/applications/)" ]; then 1.9 + updatedesktopdb=yes 1.10 + fi 1.11 cd $TOP_DIR 1.12 echo "================================================================================" 1.13 eval_gettext "\$PACKAGE (\$VERSION\$EXTRAVERSION) is installed."; echo 1.14 @@ -1292,6 +1296,13 @@ 1.15 rm -rf $TMP_DIR 1.16 } 1.17 1.18 +update_desktop_database() 1.19 +{ 1.20 + if [ -f /usr/bin/update-desktop-database ] && [ -n "$updatedesktopdb" ]; then 1.21 + update-desktop-database 1.22 + fi 1.23 +} 1.24 + 1.25 ################### 1.26 # Tazpkg commands # 1.27 ################### 1.28 @@ -1642,7 +1653,8 @@ 1.29 if [ "$DO_CHECK" = "yes" ]; then 1.30 check_for_installed_package $ROOT 1.31 fi 1.32 - install_package $ROOT ;; 1.33 + install_package $ROOT 1.34 + update_desktop_database ;; 1.35 install-list|get-install-list) 1.36 # Install a set of packages from a list. 1.37 # 1.38 @@ -2500,7 +2512,8 @@ 1.39 fi 1.40 PACKAGE_FILE=$CACHE_DIR/$PACKAGE.tazpkg 1.41 install_package $ROOT 1.42 - [ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT ;; 1.43 + [ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT 1.44 + update_desktop_database;; 1.45 clean-cache) 1.46 # Remove all downloaded packages. 1.47 #