On Sat, 11 Oct 2003 01:49:27 +0200
Michel Dänzer <[EMAIL PROTECTED]> wrote:

> On Thu, 2003-10-09 at 22:05, Felix Kühling wrote: 
> > 
> > earlier today I finally merged the config-0-0-1-branch into the trunk.
> 
> Congratulations for the good work!

Thanks.

> 
> > This means that most environment variables stop working [...]
> 
> How hard do you think it would be to allow options to be overridden by
> environment variables for debugging, along the lines of
> 
> tcl_mode=0 torcs

It would be quite simple. But I think we should not allow this in
production builds (e.g. snapshots ;-). The attached patch should do the
trick.

> 
> ?
> 
> > A configuration GUI is available at my homepage: 
> > http://fxk.de.vu/projects_cur_en.html.
> 
> Attached is a small patch for driconf 0.0.9:
> 
>       * the python gtk module in current Debian packages defaults to
>         GTK2; this fix might be Debian specific though

This one needed some tweaking. On my old Debian installation there is no
package pygtk so I got an ImportError.

>       * get the language from LC_MESSAGES

Ok.

> 
> Also, when I try to rename an application, the only thing that happens
> is that this error gets printed:
> 
> Traceback (most recent call last):
>   File "/usr/lib/python2.3/site-packages/gtk-1.2/gtk.py", line 2000, in
> __call__
>     return self.cb(_obj2inst(widget))
>   File "/home/michdaen/src/dri-cvs/driconf-0.0.9/driconf.py", line 841,
> in renameApp
>     app.name, app)
> NameError: global name 'app' is not defined

Also fixed. I'm uploading a new release right now.

> 
> 
> > 2. I'd like to move the project homepage for driconf (the configuration
> > GUI) to a more public place, either dri.sf.net or dri.freedesktop.org.
> > It would be easy to add a DriConf page to the Wiki on dri.sf.net. 
> 
> I see you've already added one, looks good.
> 
> > What about importing it into DRI CVS?
> 
> Sounds like a good idea to me.
> 
> 
> -- 
> Earthling Michel Dänzer   \  Debian (powerpc), XFree86 and DRI developer
> Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer
> 

Felix

------------    __\|/__    ___     ___       -------------------------
 Felix       ___\_e -_/___/ __\___/ __\_____   You can do anything,
   Kühling  (_____\Ä/____/ /_____/ /________)  just not everything
 [EMAIL PROTECTED]       \___/   \___/   U        at the same time.
Index: xmlconfig.c
===================================================================
RCS file: /cvs/dri/xc/xc/lib/GL/mesa/src/drv/common/xmlconfig.c,v
retrieving revision 1.2
diff -u -r1.2 xmlconfig.c
--- xmlconfig.c 9 Oct 2003 09:55:58 -0000       1.2
+++ xmlconfig.c 11 Oct 2003 22:12:45 -0000
@@ -40,6 +40,11 @@
 #include "xmlconfig.h"
 
 /*
+ * Debugging: if set to 1 then environment variables override option values.
+ */
+#define DO_DEBUG 1
+
+/*
  * OS dependent ways of getting the name of the running program
  */
 #if (defined(__unix__) || defined(unix)) && !defined(USG)
@@ -396,6 +401,16 @@
     else
        XML_FATAL ("illegal type in option: %s.", attrVal[OA_TYPE]);
 
+#if DO_DEBUG
+    {
+       const char *envDefault = getenv (cache->info[opt].name);
+       if (envDefault != NULL) {
+           attrVal[OA_DEFAULT] = envDefault;
+           XML_WARNING("default value of option %s overridden by environment.",
+                       cache->info[opt].name);
+       }
+    }
+#endif
     if (!parseValue (&cache->values[opt], cache->info[opt].type,
                     attrVal[OA_DEFAULT]))
        XML_FATAL ("illegal default value: %s.", attrVal[OA_DEFAULT]);
@@ -617,6 +632,11 @@
        GLuint opt = findOption (cache, name);
        if (cache->info[opt].name == NULL)
            XML_WARNING ("undefined option: %s.", name);
+#if DO_DEBUG
+       else if (getenv (cache->info[opt].name))
+           XML_WARNING("option value of option %s ignored.",
+                       cache->info[opt].name);
+#endif
        else if (!parseValue (&cache->values[opt], cache->info[opt].type, value))
            XML_WARNING ("illegal option value: %s.", value);
     }

Reply via email to