| OLD | NEW |
| 1 # Add icons to the system icons | 1 # Add icons to the system icons |
| 2 XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`" | 2 XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null || true`" |
| 3 if [ ! -x "$XDG_ICON_RESOURCE" ]; then | 3 if [ ! -x "$XDG_ICON_RESOURCE" ]; then |
| 4 echo "Error: Could not find xdg-icon-resource" >&2 | 4 echo "Error: Could not find xdg-icon-resource" >&2 |
| 5 exit 1 | 5 exit 1 |
| 6 fi | 6 fi |
| 7 for icon in "@@INSTALLDIR@@/product_logo_"*.png; do | 7 for icon in "@@INSTALLDIR@@/product_logo_"*.png; do |
| 8 size="${icon##*/product_logo_}" | 8 size="${icon##*/product_logo_}" |
| 9 "$XDG_ICON_RESOURCE" install --size "${size%.png}" "$icon" "@@PACKAGE@@" | 9 "$XDG_ICON_RESOURCE" install --size "${size%.png}" "$icon" "@@PACKAGE@@" |
| 10 done | 10 done |
| 11 | 11 |
| 12 UPDATE_MENUS="`which update-menus 2> /dev/null || true`" | 12 UPDATE_MENUS="`which update-menus 2> /dev/null || true`" |
| 13 if [ -x "$UPDATE_MENUS" ]; then | 13 if [ -x "$UPDATE_MENUS" ]; then |
| 14 update-menus | 14 update-menus |
| 15 fi | 15 fi |
| 16 | 16 |
| 17 # Update cache of .desktop file MIME types. Non-fatal since it's just a cache. | 17 # Update cache of .desktop file MIME types. Non-fatal since it's just a cache. |
| 18 update-desktop-database || true | 18 update-desktop-database > /dev/null 2>&1 || true |
| 19 | 19 |
| 20 # Updates defaults.list file if present. | 20 # Updates defaults.list file if present. |
| 21 update_defaults_list() { | 21 update_defaults_list() { |
| 22 # $1: name of the .desktop file | 22 # $1: name of the .desktop file |
| 23 | 23 |
| 24 local DEFAULTS_FILE="/usr/share/applications/defaults.list" | 24 local DEFAULTS_FILE="/usr/share/applications/defaults.list" |
| 25 | 25 |
| 26 if [ ! -f "${DEFAULTS_FILE}" ]; then | 26 if [ ! -f "${DEFAULTS_FILE}" ]; then |
| 27 return | 27 return |
| 28 fi | 28 fi |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 # is safe to leave even after uninstall), update it. | 69 # is safe to leave even after uninstall), update it. |
| 70 GNOME_DFL_APPS=/usr/share/gnome-control-center/gnome-default-applications.xml | 70 GNOME_DFL_APPS=/usr/share/gnome-control-center/gnome-default-applications.xml |
| 71 if [ -f "$GNOME_DFL_APPS" ]; then | 71 if [ -f "$GNOME_DFL_APPS" ]; then |
| 72 # Conditionally insert the contents of the file "default-app-block" after the | 72 # Conditionally insert the contents of the file "default-app-block" after the |
| 73 # first "<web-browsers>" line we find in gnome-default-applications.xml | 73 # first "<web-browsers>" line we find in gnome-default-applications.xml |
| 74 fgrep -q "@@MENUNAME@@" "$GNOME_DFL_APPS" || insert_after_first_match \ | 74 fgrep -q "@@MENUNAME@@" "$GNOME_DFL_APPS" || insert_after_first_match \ |
| 75 "$GNOME_DFL_APPS" \ | 75 "$GNOME_DFL_APPS" \ |
| 76 "^[ ]*<web-browsers>[ ]*$" \ | 76 "^[ ]*<web-browsers>[ ]*$" \ |
| 77 "@@INSTALLDIR@@/default-app-block" | 77 "@@INSTALLDIR@@/default-app-block" |
| 78 fi | 78 fi |
| OLD | NEW |