Default paths in Base Directory Specification

Mike Hearn m.hearn at
Tue Sep 14 12:15:49 EEST 2004

Julio M. Merino Vidal wrote:
  > IMVHO, that behavior is broken.  The programs should work after
> installation without
> having to mess with the environment.  In fact, they _can know_ where
> they got installed,
> so it's not a problem for them to access their own files.

The basedir spec isn't about programs not being able to access their 
*own* files, it's about being able to locate *shared* files like the 
MIME database. That means you have to set it once, and then all the 
applications can use that. It's not different to setting PATH at bootup.

> So my question is... why is it done the way it is?  /usr/local and
> /usr may be good
> choices for Linux, but they are clearly a disadvantage for other
> systems.  (I'm still
> trying to find a rationale behind the current decision, so please
> enlighten me...)

It's done this way because the files this variable is supposed to point 
to aren't app specific, so it would be wrong to make it vary between 
applications. They are global shared desktop data which means you only 
need to set it once if you install your freedesktop stuff (mime db, menu 
definitions etc) to somewhere other than /usr or /usr/local. There's 
nothing GNOME specific about this.

> Could the default values in the specification be changed to include
> the installation
> prefix as the main directory in the path?  Telling the users to set
> their environment
> up properly will result in lots of confusion and statements like "bah,
> NetBSD is worse
> because I have to set this up by hand, while Linux does it just well"
> (substitute
> NetBSD with your favourite system that uses custom directories).

Just set them to /usr/pkg/share on startup, and you're done. It's a 
couple of environment variables, I really don't see the big deal.

thanks -mike

More information about the xdg mailing list