Linux: Cleaners do not obey XDG base directory specification
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
BleachBit |
Fix Released
|
Medium
|
Unassigned |
Bug Description
The directories ~/.local/share, ~/.config and ~/.cache are part of the XDG Base Directory Specification[¹]. Currently cleaners reference them directly which is prohibited by the spec!
Instead one has to first check if an environment variable is set (there is one for each of them) and only fall back to these directories if no corresponding environment variable has been found.
Step 1:
Basically BleachBit should provide these directories as variables instead of forcing cleaners to hard-code the default values:
Replace "$XDG_DATA_HOME" with os.environ.
Replace "$XDG_CONFIG_HOME" with os.environ.
Replace "$XDG_CACHE_HOME" with os.environ.
Step 2:
Replace the current hard-coded defaults with theses variable names in all current CleanerML files.
Step 3:
Add information about this to the Wiki-Page so that people writing new cleaners know about this.
Affects: Linux (all distributions); All cleaners for applications already implementing this specification
[¹]http://
Changed in bleachbit: | |
milestone: | none → 1.10 |
Changed in bleachbit: | |
milestone: | 1.10 → 1.12 |
Changed in bleachbit: | |
importance: | Undecided → Medium |
Changed in bleachbit: | |
assignee: | nobody → Andrew Ziem (ahziem1) |
status: | New → In Progress |
Changed in bleachbit: | |
status: | Fix Committed → In Progress |
Changed in bleachbit: | |
status: | In Progress → Fix Committed |
The fix for step two was to execute the following commands in the bleachbit- code/cleaners directory: config/ $XDG_CONFIG_ HOME/g' * cache/$ XDG_CACHE_ HOME/g' * local\/ share/$ XDG_DATA_ HOME/g' *
sed -i 's/~\/.
sed -i 's/~\/.
sed -i 's/~\/.
This should probably also be done with the cleanerml git repository.