Bug 821565 - Use XDG dirs instead of $HOME
Use XDG dirs instead of $HOME
Product: Fedora
Classification: Fedora
Component: rpm (Show other bugs)
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Fedora Packaging Toolset Team
Fedora Extras Quality Assurance
Depends On:
  Show dependency treegraph
Reported: 2012-05-14 20:14 EDT by jmccann
Modified: 2015-02-17 09:15 EST (History)
9 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2015-02-17 09:15:14 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description jmccann 2012-05-14 20:14:02 EDT
rpm uses ~/.rpmrc and ~/.rpmmacros. It would be better to use the locations defined in the XDG Base Directory specification.

Comment 2 Panu Matilainen 2012-12-03 02:36:57 EST
I'm not terribly keen on invalidating 10+ years of documentation and community knowledge by moving the per-user rpm configuration to appease GNOME agendas, especially as rpm is most certainly NOT a "desktop application".
Comment 3 Mathieu Bridon 2012-12-03 03:03:17 EST
Why not do it like Git did?

Git will first try to read ~/.config/git/config, then ~/.gitconfig if the former doesn't exist.

They didn't break any community-knowledge nor documentation, because the old path still works just as well.
Comment 4 Jan Zeleny 2012-12-03 03:10:44 EST
You are still trying to mix desktop-focused specification with configuration of low-level tool that desktop user will use only minimally. I don't think that's a good idea. Furthermore I don't see any real gain in this change neither on server nor on desktop.
Comment 5 Mathieu Bridon 2012-12-03 03:24:05 EST
The XDG specs are not only for desktop stuff, they are for user data and configuration.

As a Fedora packager, I am a user of rpm, so files like ~/.rpmmacros are user configuration.

And there are real gains to the migration.

One of them is that of backups: currently, I would have to backup every single dot file in my home folder if I wanted to preserve my user configuration. Moving to XDG folders, I can backup only .config (and .local for user data).

That means I will not forget to add a new dot file to my backups when I start using new software.

Some other advantages were given in the first link Eric provided in comment 1.
Comment 6 Panu Matilainen 2012-12-03 03:38:06 EST
There's no "if foo doesn't exist then read bar" logic in rpm's configuration system, everything in the macro path is read inclusively in the specified order if they exist. So if both ~/.rpmmacros and eg ~/.config/rpmmacros exist one will take precedense and if the contents differ you'll get confused users for little added value.

Another problem is that you can't rely on eg $XDG_CONFIG_HOME and such being set, so properly supporting the XDG spec would require extra logic over the current simple "macro path" to handle the cases where its set and falling back to default ~/.config/ if not.

In other words, it requires adding extra complexity to rpm's configuration system AND dealing with the consequent migration pains for the next 5-10 years.

Mind you, I'm not adverse to the idea of centralized configuration in ~/.config/, which is why I haven't closed this WONTFIX by now. It's more a question of waiting for the right opportunity, such as other events/enhancements suddenly making supporting the XDG directory spec more desireable/feasible.
Comment 7 Panu Matilainen 2012-12-03 05:37:10 EST
Oh and BTW, "forgetting to add a new dot file to backups" is IMO an entirely backwards approach. For backups you'll want everything that's not *excluded*. 

There's really a snowball's chance in hell that all software ever written will be "fixed" to comply with XDG, so you can really never stop backing up all the dotfiles. Its far more productive to try to get the worst offenders to place their disposable data info a known exclude-location, such as browsers putting their cached data into XDG cache which can be easily excluded.
Comment 8 Eric Heintzmann 2013-01-05 07:48:31 EST
Full specification can be found at: 

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 )
- 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.
Comment 9 Panu Matilainen 2013-01-07 05:40:19 EST
Automated advertisement spam for a specification? That's a new one... but just as annoying as any spam. If anything, such spam is going to make me LESS likely to do the damnest thing about this. Dont do it again.
Comment 10 Eric Heintzmann 2013-01-07 14:34:08 EST
This was not a spam
Comment 11 Fedora End Of Life 2013-04-03 12:47:38 EDT
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
Comment 12 Fedora End Of Life 2015-01-09 12:09:00 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 14 Fedora End Of Life 2015-02-17 09:15:14 EST
Fedora 19 changed to end-of-life (EOL) status on 2015-01-06. Fedora 19 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.