The test environment does not support the XDG Special User Directories
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Déjà Dup |
Fix Released
|
Low
|
Naël |
Bug Description
[XDG Special User Directories]
The XDG Special User Directories are a set of (eight) localized user directories for storing documents, downloads, music, pictures, videos, and so on. Their paths are defined for each user in the file $XDG_CONFIG_
Applications can read this file to find the directories in a locale-independent manner. Déjà-Dup uses the function GLib.Environmen
The file $XDG_CONFIG_
[Non-support by the test shell]
The test shell changes XDG_CONFIG_HOME to /tmp/dd-
As a result the new $XDG_CONFIG_
[Impact]
This is why the exclude list displayed in deja-dup-
This is why including $DOCUMENTS, $DOWNLOAD, $MUSIC, $PICTURES, $VIDEOS, $TEMPLATES and/or $PUBLIC_SHARE in the include-list and exclude-list keys of org.gnome.DejaDup does not lead to them being passed to duplicity as --include and --exclude options. That puzzled me to no end when I was testing a hack to solve bug 1549776, see comments 8, 11, 12.
From what I understand, $DOWNLOAD also features as an exclude in a number of test scripts (in deja-dup/
[Fix]
Simply adding one of the following lines to the test shell's script, in the section "Create fake home environment", ensures that the user's current XDG Special User Directories are found, by creating a file user-dirs.dirs in the new XDG_CONFIG_HOME:
ln -s "${HOME}
cp "${HOME}
xdg-user-
Alternatively, new XDG Special User Directories can be created in the test environment /tmp/dd-<temp>, instead of using the user's current ones, which are not adapted to tests since they contain the user's data rather than unimportant test data. In theory, the simplest way to do so is to point HOME to the test environment as I suggest in bug 1660174, and then issue xdg-user-
HOME="${ROOTDIR}"
xdg-user-
But this doesn't work because xdg-user-
So we have to do everything by hand, for instance with:
OLD_HOME=
HOME="${ROOTDIR}"
if [ -f "${OLD_
-a -f "${OLD_
then
cp "${OLD_
cp "${OLD_
. "${XDG_
for d in DESKTOP DOCUMENTS DOWNLOAD MUSIC PICTURES \
do
eval mkdir -p "\${XDG_${d}_DIR}"
done
fi
[Patch]
Attached is a patch for deja-dup/
[References]
https:/
https:/
https:/
xdg-user-
xdg-user-dir(1)
user-dirs.dirs(5)
user-dirs.
Related branches
- Michael Terry: Approve
-
Diff: 55 lines (+16/-2)1 file modifiedtests/shell (+16/-2)
Changed in deja-dup: | |
status: | New → Triaged |
importance: | Undecided → Low |
Changed in deja-dup: | |
assignee: | nobody → Naël (nathanael-naeri) |
status: | Triaged → In Progress |
Changed in deja-dup: | |
status: | In Progress → Fix Committed |
And here is a patch that implements the fix I suggest, plus those I suggest for bugs 1660174 and 1660224 as an added bonus (on top of the current revision 1570):
1660174: set HOME to the test environment /tmp/dd-<temp>
1660224: include a trash can in the test environment
1660342: setup XDG Special User Directories in the test environment
The whole thing makes the fake home environment more similar to the actual one IMHO.