[Bug 3334] Make a default Templates config

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3334

           Summary: Make a default Templates config
           Product: Validator
           Version: 0.7.1
          Platform: Macintosh
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: check
        AssignedTo: link@pobox.com
        ReportedBy: ask@develooper.com
         QAContact: www-validator-cvs@w3.org


This patch makes a reasonable default for the Templates configuration and makes
how to set W3C_VALIDATOR_CFG a little clearer. 

--- /tmp/validator-0.7.2/httpd/cgi-bin/check    2006-02-18 12:06:41.000000000
-0800
+++ validator/cgi-bin/check     2006-06-14 23:13:06.000000000 -0700
@@ -107,6 +107,7 @@

   #
   # Read Config Files.
+  my $base = $ENV{W3C_VALIDATOR_HOME} || '/usr/local/validator';
   eval {
     my %config_opts = (
        -ConfigFile => ($ENV{W3C_VALIDATOR_CFG} || '/etc/w3c/validator.conf'),
@@ -121,7 +122,8 @@
        -DefaultConfig    => {
           Protocols => {Allow => 'http,https'},
           Paths => {
-            Base => ($ENV{W3C_VALIDATOR_HOME} || '/usr/local/validator'),
+            Base => $base,
+            Templates => "$base/share/templates",
             SGML => {Parser => '/usr/bin/onsgmls'},
           },
        },
@@ -132,8 +134,9 @@
   if ($@) {
     die <<".EOF.";
 Could not read configuration.  Set the W3C_VALIDATOR_CFG environment variable
-or copy conf/* to /etc/w3c/. Make sure that the configuration file and all
-included files are readable by the web server user. The error was:\n'$@'
+to point to the validator.conf file or copy conf/* to /etc/w3c/. Make sure
+that the configuration file and all included files are readable by the web
+server user. The error was:\n'$@'
 .EOF.
   }

Received on Thursday, 15 June 2006 06:20:42 UTC