Bug 821565

Summary: Use XDG dirs instead of $HOME
Product: [Fedora] Fedora Reporter: jmccann
Component: rpmAssignee: Fedora Packaging Toolset Team <packaging-team>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 19CC: bochecha, cschalle, ffesti, Heintzmann.Eric, jzeleny, maurizio.antillon, packaging-team, pknirsch, pmatilai
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-17 14:15:14 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description jmccann 2012-05-15 00:14:02 UTC
rpm uses ~/.rpmrc and ~/.rpmmacros. It would be better to use the locations defined in the XDG Base Directory specification.

https://live.gnome.org/GnomeGoals/XDGConfigFolders

Comment 2 Panu Matilainen 2012-12-03 07:36:57 UTC
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 08:03:17 UTC
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 08:10:44 UTC
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 08:24:05 UTC
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 08:38:06 UTC
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 10:37:10 UTC
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 12:48:31 UTC
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.

Comment 9 Panu Matilainen 2013-01-07 10:40:19 UTC
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 19:34:08 UTC
This was not a spam

Comment 11 Fedora End Of Life 2013-04-03 16:47:38 UTC
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:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 12 Fedora End Of Life 2015-01-09 17:09:00 UTC
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 14:15:14 UTC
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
bug.

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