The test environment does not include a trash can

Bug #1660224 reported by Naël
4
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Déjà Dup
Fix Released
Low
Naël

Bug Description

The trash can is normally the directory $XDG_DATA_HOME/Trash, with XDG_DATA_HOME defaulting to $HOME/.local/share. As far as I know, this directory is created the first time the file manager sends something to it.

The test shell changes XDG_DATA_HOME to /tmp/dd-<temp>/share, but doesn't create a Trash subfolder. As a result, when the trash can is in the include list or the exclude list (it is in the default exclude list ['$DOWNLOAD', '$TRASH']), the non-existent folder is not taken into by Déjà Dup (rightfully so, since it doesn't exist) : the --include or --exclude options passed to duplicity do not feature it. You can check with "DEJA_DUP_DEBUG=1 deja-dup --backup > dd.log" in the test shell.

This confused me to no end when I was hacking Déjà Dup and couldn't figure out why this exclude was not passed to duplicity.

From what I understand, this default exclude also features in a number of test scripts (in deja-dup/libdeja/tests/scripts) which are run by the test shell during make check. If it's tested, it might as well exist.

Simply creating an empty trash directory in the new XDG_DATA_HOME makes the fake home environment a bit more complete, and avoids confusion about Déjà Dup appearing to not take this exclude into account. Thanks.

Trivial patch attached, can be applied to Déjà Dup's current revision 1570. All the tests (make check) pass. "DEJA_DUP_DEBUG=1 deja-dup --backup > patch.log" shows that the now-existing trash can is passed to duplicity.

Related branches

Revision history for this message
Naël (nathanael-naeri) wrote :
Revision history for this message
Vej (vej) wrote :

Hello Nathanaël.

I can at lest confirm the bug now and will try to look into the bugfix later this week.

Best Regards

Vej

Changed in deja-dup:
status: New → Triaged
importance: Undecided → Low
Naël (nathanael-naeri)
Changed in deja-dup:
assignee: nobody → Naël (nathanael-naeri)
status: Triaged → In Progress
Michael Terry (mterry)
Changed in deja-dup:
status: In Progress → Fix Committed
Revision history for this message
Vej (vej) wrote :

This had been released as a part of Déjà Dup 34.4.

Changed in deja-dup:
status: Fix Committed → Fix Released
assignee: Nathanaël Naeri (Naël) (nathanael-naeri) → nobody
Naël (nathanael-naeri)
Changed in deja-dup:
assignee: nobody → Nathanaël Naeri (Naël) (nathanael-naeri)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.