Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
None
-
3.0.6
-
None
-
Gentoo Linux AMD64.
-
-
d6768e5a16521c11fffb4b50eaf085f8c13272a7 (installer-framework/installer-framework/3.1)
Description
(I'm not sure who's responsible for this bug. I filed it as an installer bug, but it might be a Qt bug.)
I installed Qt Creator 4.8.1 using the online installer for Linux (64-bit) and this resulted in desktop files and icons being installed into the wrong directory. They were installed into ~/.local/share/flatpak/exports/share/ instead of ~/.local/share/.
This seems to be due to non-conformance to the XDG Base Directory Specification. The environment variable XDG_DATA_HOME specifies the directory where these files should be stored. If the variable is not defined or is empty, then ~/.local/share/ must be used. This is not what the Qt installer does. It instead uses the first directory specified in XDG_DATA_DIRS, which is not the purpose of that variable. For storing files, only XDG_DATA_HOME must be used, or ~/.local/share/ if the env var is empty. XDG_DATA_DIRS should not be used.
Relevant wording in the spec (emphasis is mine):
There is a single base directory relative to which user-specific data files should be written. This directory is defined by the environment variable $XDG_DATA_HOME.
There is a set of preference ordered base directories relative to which data files should be searched. This set of directories is defined by the environment variable $XDG_DATA_DIRS. {{}}
$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used.
$XDG_DATA_DIRS defines the preference-ordered set of base directories to search for data files in addition to the $XDG_DATA_HOME base directory
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html
On my system, XDG_DATA_HOME is not defined, meaning installation files should go to ~/.local/share/. But XDG_DATA_DIRS is not empty:
$ echo $XDG_DATA_DIRS
/home/realnc/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share:/usr/share
The Qt installer seems to pick the first path of XDG_DATA_DIRS instead of using ~/.local/share/.
Attachments
Issue Links
- resulted from
-
QTIFW-1043 CreateDesktopEntry doesn't use set XDG_DATA_DIRS or XDG_DATA_HOME values
-
- Closed
-
For Gerrit Dashboard: QTIFW-1269 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
250549,4 | Write desktop entry and items to the correct folders | 3.1 | installer-framework/installer-framework | Status: MERGED | +2 | 0 |