fedora-selinux / setroubleshoot

Abandoned, use https://gitlab.com/setroubleshoot
https://gitlab.com/setroubleshoot
9 stars 12 forks source link

Use XDG_CONFIG_HOME instead of home for config files #51

Open bachradsusi opened 7 years ago

bachradsusi commented 7 years ago

Reported by mccann at https://fedorahosted.org/setroubleshoot/ticket/11

It would be great if setroubleshoot could follow the XDG base directory specification and use XDG_CONFIG_HOME instead of HOME for configuration and logging files. ​http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

There are a number of benefits to this including making it much easier to migrate data between systems and across upgrades.

Currently I have ~/.setroubleshoot

bachradsusi commented 7 years ago

A comment from jardon:

According to fd.o specification, it should put user preferences in $XDG_CONFIG_HOME.

Any user date should go to $XDG_DATA_HOME.

Any cache stuffs should go to $XDG_CACHE_HOME.

More infos:

http://standards.freedesktop.org/basedir-spec/latest/ar01s03.htmlhttps://live.gnome.org/GnomeGoals/XDGConfigFolders

Glib convenience functions here: ​http://developer.gnome.org/glib/2.32/glib-Miscellaneous-Utility-Functions.html#g-get-user-cache-dir

bachradsusi commented 7 years ago

Changed 4 years ago by eheintzmann:

What is planned now about FreeDesktop? XDG basedir specification for setroubleshoot?

http://ploum.net/post/207-modify-your-application-to-use-xdg-foldershttps://live.gnome.org/GnomeGoals/XDGConfigFoldershttp://standards.freedesktop.org/basedir-spec/latest/

bachradsusi commented 7 years ago

Changed 4 years ago by eheintzmann

More details at : ​http://ploum.net/post/207-modify-your-application-to-use-xdg-foldershttps://live.gnome.org/GnomeGoals/XDGConfigFolders

Full specification can be found at: ​http://standards.freedesktop.org/basedir-spec/latest/

The Freedesktop.org XDG base directory specification have good de facto adoption. It has been adopted by:

GNOME ( ​https://live.gnome.org/GnomeGoals/XDGConfigFolders )
GTK+ ( ​https://bugzilla.gnome.org/show_bug.cgi?id=646631 )
KDE ( ​http://techbase.kde.org/KDE_System_Administration/XDG_Filesystem_Hierarchy#Freedesktop.org_and_Standard_Directories )
QT ( ​http://harmattan-dev.nokia.com/docs/library/html/qt4/qsettings.html#setPath )
XFCE ( ​http://docs.xfce.org/xfce/xfce4-session/advanced in Files and Environment Variables )
LXDE
Razor-qt
VLC ( ​https://trac.videolan.org/vlc/ticket/1267 )
GStreamer ( ​https://bugzilla.gnome.org/show_bug.cgi?id=518597 )
Chrome ( ​http://code.google.com/p/chromium/issues/detail?id=16976 )
many more upstream applications
Ubuntu ( ​http://brainstorm.ubuntu.com/idea/6557/ & ​http://packages.ubuntu.com/fr/source/precise/libxdg-basedir )
Debian ( ​http://packages.debian.org/squeeze/libxdg-basedir1 )
Red Hat
Fedora
Suse
many more distributions 

I think that @APPNAME@ should use same locations than the vast majority of Desktop environment and applications.

There are real advantages of following this specification :

a lot less cluttered $HOME
Make backups a lot more safer and easier. Backuping your $XDG_DATA_HOME along with your files is enough (or just excluding $XDG_CACHE_HOME)
A lot easier to reset a default configuration if you want/need it (and without any risk to loose informations). Even for the software itself could choose to reset $XDG_CONFIG_HOME if needed.
Avoid some strange bugs that happens because you had a old version of some configuration file
A lot more of flexibility and portability because no path are hardcoded.