[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xdg
Subject:    Basedir Specification migration path
From:       Richard Boulton <richard () tartarus ! org>
Date:       2003-08-22 14:38:26
Message-ID: 1061563106.4107.28.camel () scary ! honest ! gov
[Download RAW message or body]

I've been hacking a few patches to applications that I use to make them
follow the basedir specification.  [My main motivation for this is that
I have a newly installed machine, and I'm trying to keep the home
directories reasonably clean.]

I would like to submit these patches to the application maintainers, but
at present I think there is little likelihood of them being accepted
since the specification is relatively immature, and accepting the
patches would break the application for all other users (by changing the
locations which are searched for configuration files).

If there was a well defined means by which basedir support could be
added to applications without it being the default, at least initially,
I believe getting such patches accepted would be much easier.

The attached patch to the basedir specification is my attempt at adding
such a mechanism.  I hope its reasonably self-explanatory.

-- 
Richard Boulton <richard@tartarus.org>

["migration.patch" (migration.patch)]

Index: basedir-spec.xml
===================================================================
RCS file: /freedesktop/basedir-spec/basedir-spec.xml,v
retrieving revision 1.2
diff -u -r1.2 basedir-spec.xml
--- basedir-spec.xml	1 Aug 2003 20:17:28 -0000	1.2
+++ basedir-spec.xml	22 Aug 2003 14:03:57 -0000
@@ -4,8 +4,8 @@
 <article id="index">
   <artheader>
     <title>XDG Base Directory Specification</title>
-    <releaseinfo>Version 0.6</releaseinfo>
-    <date>31 July 2003</date>
+    <releaseinfo>Version 0.7</releaseinfo>
+    <date>22 August 2003</date>
     <authorgroup>
       <author>
 	<firstname>Waldo</firstname>
@@ -219,6 +219,83 @@
       important base directory should be used or, as another example,
       it could define rules for merging the information from the different
       files.
+    </para>
+  </sect1>
+
+  <sect1 id="migration">
+    <title>Migration to this specification</title>
+    <para>
+      Applications may wish to add support for this specification, but be
+      reluctant to force all their users to move their configuration data
+      around.  So that application authors can perform a gradual migration
+      in a standardised way, an environment variable is defined to specify
+      whether support for the basedir specification is desired.
+      It is hoped that this will also encourage application authors to accept
+      patches which add basedir support to their application.
+    </para>
+    <para>
+      A gradual migration may be performed by means of the environment variable
+      <literal>$XDG_OBEY_BASEDIR</literal>.
+      <itemizedlist>
+        <listitem>
+          <para>
+            If <literal>$XDG_OBEY_BASEDIR</literal> is not set or empty, the
+	    application may choose whether to follow the basedir specification.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            If <literal>$XDG_OBEY_BASEDIR</literal> is set to any non-empty
+	    value other than "0", the application must follow the basedir
+	    specification.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+            If <literal>$XDG_OBEY_BASEDIR</literal> is set to "0", the
+	    application should use legacy locations.  This option is provided
+	    so that application authors may make their application follow the
+	    basedir specification by default, whilst allowing users to request
+	    the old behaviour in a simple way.
+          </para>
+        </listitem>
+      </itemizedlist>
+    </para>
+    <para>
+      An application need only pay any attention to this environment variable
+      if it wishes to support legacy directory locations.  Authors of
+      new applications, or who do not need a gradual migration, are encouraged
+      to support the basedir specification unconditionally.
+    </para>
+    <para>
+      A typical migration path would be:
+      <orderedlist>
+        <listitem>
+          <para>
+	    Application has no support for basedir spec.
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+	    Application adds support for basedir spec, but only follows the
+	    spec if <literal>$XDG_OBEY_BASEDIR</literal> is set, and not set
+	    to "0".
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+	    Application adds support for basedir spec by default, but allows
+	    users to request the legacy locations by setting
+	    <literal>$XDG_OBEY_BASEDIR</literal> to "0".
+          </para>
+        </listitem>
+        <listitem>
+          <para>
+	    Application removes legacy support, and supports basedir spec
+	    regardless of <literal>$XDG_OBEY_BASEDIR</literal>.
+          </para>
+        </listitem>
+      </orderedlist>
     </para>
   </sect1>
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic