GetAppmenus: ensure right app directories

The script depends on XDG_DATA_DIRS environment variable
being set up correctly, which is not the case when it is
running under sudo. As a result, a post-install trigger
for apt could remove application entries from other sources
(Snap, Flatpak).

Fixes QubesOS/qubes-issues#5477.
This commit is contained in:
Pawel Marczewski 2020-01-07 15:45:05 +01:00
parent b20373213d
commit 552b6de862
No known key found for this signature in database
GPG Key ID: DE42EE9B14F96465

View File

@ -6,6 +6,15 @@
# - directories stored on /rw in case of "rw-only" persistence
# - nothing, otherwise
# Reload scripts in /etc/profile.d/, in case they register additional
# directories in XDG_DATA_DIRS and we forgot them
# (e.g. because we are running under sudo).
for i in /etc/profile.d/*.sh ; do
if [ -r "$i" ]; then
. "$i" >/dev/null
fi
done
if [ -z "$XDG_DATA_HOME" ]; then
XDG_DATA_HOME="$HOME/.local/share"
fi