snap launcher: avoid exporting XDG_CACHE_HOME
Exporting XDG_CACHE_HOME affects applications launched from within the context of code. Rename it to GDK_CACHE_DIR and do not export it. Also test for existence before creating to avoid shelling out to mkdir if not needed. Signed-off-by: Sergio Schvezov <sergio.schvezov@canonical.com>pull/91182/head
parent
a100802412
commit
d4da28357f
|
@ -14,15 +14,15 @@ else
|
|||
ARCH="$SNAP_ARCH-linux-gnu"
|
||||
fi
|
||||
|
||||
export XDG_CACHE_HOME="$SNAP_USER_COMMON/.cache"
|
||||
if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$XDG_CACHE_HOME" ]]; then
|
||||
GDK_CACHE_DIR="$SNAP_USER_COMMON/.cache"
|
||||
if [[ -d "$SNAP_USER_DATA/.cache" && ! -e "$GDK_CACHE_DIR" ]]; then
|
||||
# the .cache directory used to be stored under $SNAP_USER_DATA, migrate it
|
||||
mv "$SNAP_USER_DATA/.cache" "$SNAP_USER_COMMON/"
|
||||
fi
|
||||
mkdir -p "$XDG_CACHE_HOME"
|
||||
[ ! -d "$GDK_CACHE_DIR" ] && mkdir -p "$GDK_CACHE_DIR"
|
||||
|
||||
# Gdk-pixbuf loaders
|
||||
export GDK_PIXBUF_MODULE_FILE="$XDG_CACHE_HOME/gdk-pixbuf-loaders.cache"
|
||||
export GDK_PIXBUF_MODULE_FILE="$GDK_CACHE_DIR/gdk-pixbuf-loaders.cache"
|
||||
export GDK_PIXBUF_MODULEDIR="$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/2.10.0/loaders"
|
||||
if [ -f "$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" ]; then
|
||||
"$SNAP/usr/lib/$ARCH/gdk-pixbuf-2.0/gdk-pixbuf-query-loaders" > "$GDK_PIXBUF_MODULE_FILE"
|
||||
|
|
Loading…
Reference in New Issue