This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 3334 - Make a default Templates config
Summary: Make a default Templates config
Status: RESOLVED FIXED
Alias: None
Product: Validator
Classification: Unclassified
Component: check (show other bugs)
Version: 0.7.3
Hardware: Macintosh All
: P2 normal
Target Milestone: 0.7.4
Assignee: Terje Bless
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-06-15 06:20 UTC by Ask Bj
Modified: 2006-11-10 01:03 UTC (History)
0 users

See Also:


Attachments

Description Ask Bj 2006-06-15 06:20:39 UTC
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.
   }
Comment 1 Olivier Thereaux 2006-10-31 02:59:59 UTC
looks good, will apply and adapt if necessary. Thank you!
Comment 2 Olivier Thereaux 2006-11-10 01:03:20 UTC
Done in CVS, will be in the upcoming bugfix release. 
Will also port it to the development version.