Skip to content

Respect XDG Base Directory Specification #1538

Open
@Perlovka

Description

@Perlovka

Hi all,
This is not a bug report, because practice has prove that XDG specs, linux users and common sense are ignored by Arduino project.

So, like in arduino/Arduino#7651, I'll just provide a patch that fixes the issue for linux users seeking to keep their home directories clean.

NOTE: This patch does not make any sense for Windows and Mac users. Sorry.

Some info about XDG base directory specification:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html#introduction

The patch : https://github.com/Perlovka/portage-overlay/blob/1a8ac45f54f40e1bc6e697aeee4f973248277ee2/dev-embedded/arduino-cli/files/arduino-cli-0.19.3-xgd-compliance.patch

Updated version: https://github.com/Perlovka/portage-overlay/blob/eeb083c401b7c2d45fcdbb08f0fe5e7b426ff15f/dev-embedded/arduino-cli/files/arduino-cli-0.19.3-xgd-compliance.patch
This version uses arduino for all directory names instead of arduino-cli
Also, used built in Go functions for UserConfigDir and UserCacheDir, which works also for Mac and Win users.

Latest version of the patch could always be found here: https://github.com/Perlovka/portage-overlay/tree/master/dev-embedded/arduino-cli/files

Directory layout after applying the patch:

~ $ ls -1 ~/.cache/arduino/
staging
tmp
 ~ $ ls -1 --group-directories-first ~/.local/share/arduino/
libraries
packages
inventory.yaml
library_index.json
library_index.json.sig
package_index.json
package_index.json.sig

This patch also fixed configDir path, that is mentioned here:

configDir = getDefaultArduinoDataDir()

But seems that this value is currently not used elsewhere in the code.

Cheers, may Linux be with you.

Metadata

Metadata

Assignees

Labels

os: linuxSpecific to Linux operating systemtopic: codeRelated to content of the project itselftype: enhancementProposed improvement

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions