From 2d28c0a79c87c70be93dbe73fe0a18fa12e0e7e9 Mon Sep 17 00:00:00 2001 From: Robo Date: Fri, 11 Oct 2024 23:56:43 +0900 Subject: [PATCH] fix: use the mime package from snap to generate db (#231119) --- resources/linux/snap/electron-launch | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/resources/linux/snap/electron-launch b/resources/linux/snap/electron-launch index 873b079161a45..9d0a2bc897668 100755 --- a/resources/linux/snap/electron-launch +++ b/resources/linux/snap/electron-launch @@ -116,11 +116,12 @@ prepend_dir XDG_DATA_DIRS "$SNAP/data-dir" prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA" # Set XDG_DATA_HOME to local path -ensure_dir_exists "$SNAP_USER_DATA/.local/share" +export XDG_DATA_HOME="$SNAP_USER_DATA/.local/share" +ensure_dir_exists "$XDG_DATA_HOME" # Workaround for GLib < 2.53.2 not searching for schemas in $XDG_DATA_HOME: # https://bugzilla.gnome.org/show_bug.cgi?id=741335 -prepend_dir XDG_DATA_DIRS "$SNAP_USER_DATA/.local/share" +prepend_dir XDG_DATA_DIRS "$XDG_DATA_HOME" # Set cache folder to local path if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$SNAP_USER_COMMON/.cache" ]]; then @@ -169,11 +170,11 @@ IFS=':' read -r -a data_dirs_array <<< "$XDG_DATA_DIRS" # Build mime.cache # needed for gtk and qt icon if [ "$needs_update" = true ]; then - rm -rf "$SNAP_USER_DATA/.local/share/mime" + rm -rf "$XDG_DATA_HOME/mime" if [ ! -f "$SNAP/usr/share/mime/mime.cache" ]; then - if command -v update-mime-database >/dev/null; then - cp --preserve=timestamps -dR "$SNAP/usr/share/mime" "$SNAP_USER_DATA/.local/share" - async_exec update-mime-database "$SNAP_USER_DATA/.local/share/mime" + if command -v $SNAP/usr/bin/update-mime-database >/dev/null; then + cp --preserve=timestamps -dR "$SNAP/usr/share/mime" "$XDG_DATA_HOME" + async_exec $SNAP/usr/bin/update-mime-database "$XDG_DATA_HOME/mime" fi fi fi