- From: Ville Skytta via cvs-syncmail <cvsmail@w3.org>
- Date: Sun, 04 Jan 2009 10:41:22 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/validator/httpd/cgi-bin In directory hutz:/tmp/cvs-serv26347/httpd/cgi-bin Modified Files: check sendfeedback.pl Log Message: Use File::Spec::Functions for somewhat more compact code. Index: sendfeedback.pl =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/sendfeedback.pl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- sendfeedback.pl 25 May 2007 21:34:29 -0000 1.8 +++ sendfeedback.pl 4 Jan 2009 10:41:20 -0000 1.9 @@ -10,10 +10,10 @@ ## Modules. See also the BEGIN block further down below. -use CGI qw(); -use HTML::Template 2.6 qw(); -use Config::General 2.19 qw(); # Need 2.19 for -AutoLaunder -use File::Spec qw(); +use CGI qw(); +use File::Spec::Functions qw(catfile); +use HTML::Template 2.6 qw(); +use Config::General 2.19 qw(); # Need 2.19 for -AutoLaunder use vars qw($DEBUG $CFG $RSRC $VERSION $HAVE_IPC_RUN); # Define global constants @@ -70,8 +70,8 @@ # Read error message + explanations file our %rsrc = Config::General->new( -MergeDuplicateBlocks => 1, - -ConfigFile => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'error_messages.cfg'), + -ConfigFile => catfile($CFG->{Paths}->{Templates}, $lang, + 'error_messages.cfg'), )->getall(); # Config::General workarounds for <msg 0> issues: # http://lists.w3.org/Archives/Public/public-qa-dev/2006Feb/0022.html @@ -85,7 +85,7 @@ $RSRC = \%rsrc; our $T = HTML::Template->new( - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, $lang, 'feedback.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'feedback.tmpl'), die_on_bad_params => FALSE, ); Index: check =================================================================== RCS file: /sources/public/validator/httpd/cgi-bin/check,v retrieving revision 1.612 retrieving revision 1.613 diff -u -d -r1.612 -r1.613 --- check 4 Jan 2009 10:23:10 -0000 1.612 +++ check 4 Jan 2009 10:41:20 -0000 1.613 @@ -53,7 +53,7 @@ use Encode::HanExtra qw(); # for some chinese character encodings, # e.g gb18030 use Encode::JIS2K qw(); # ditto extra japanese encodings -use File::Spec qw(); +use File::Spec::Functions qw(catfile); use HTML::Encoding 0.52 qw(); use HTML::Parser 3.25 qw(); # Need 3.25 for $p->ignore_elements. use HTML::Template 2.6 qw(); @@ -208,8 +208,8 @@ # Read friendly error message file my %rsrc = Config::General->new( -MergeDuplicateBlocks => 1, - -ConfigFile => File::Spec->catfile($CFG->{Paths}->{Templates}, - 'en_US', 'error_messages.cfg'), + -ConfigFile => catfile($CFG->{Paths}->{Templates}, 'en_US', + 'error_messages.cfg'), )->getall(); # 'en_US' should be replaced by $lang for lang-neg # Config::General workarounds for <msg 0> issues: @@ -325,84 +325,74 @@ $File->{Templates}->{Result} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'result.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'result.tmpl'), loop_context_vars => TRUE, ); $File->{Templates}->{Error} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'fatal-error.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'fatal-error.tmpl'), ); $File->{Templates}->{AuthzReq} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'http_401_authrequired.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, + 'http_401_authrequired.tmpl'), ); # templates for alternate output formats $File->{Templates}->{XML} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'xml_output.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'xml_output.tmpl'), loop_context_vars => TRUE, ); $File->{Templates}->{SOAP} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'soap_output.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'soap_output.tmpl'), loop_context_vars => TRUE, ); -$File->{Templates}->{UCN} = HTML::Template->new( +$File->{Templates}->{SOAPFault} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'ucn_output.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'soap_fault.tmpl'), loop_context_vars => TRUE, ); -$File->{Templates}->{SOAPFault} = HTML::Template->new( +$File->{Templates}->{SOAPDisabled} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'soap_fault.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'soap_disabled.tmpl'), loop_context_vars => TRUE, ); -$File->{Templates}->{SOAPDisabled} = HTML::Template->new( +$File->{Templates}->{UCN} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'soap_disabled.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'ucn_output.tmpl'), loop_context_vars => TRUE, ); $File->{Templates}->{EARLXML} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'earl_xml.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'earl_xml.tmpl'), loop_context_vars => TRUE, global_vars => TRUE, ); $File->{Templates}->{EARLN3} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'earl_n3.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'earl_n3.tmpl'), loop_context_vars => TRUE, global_vars => TRUE, ); $File->{Templates}->{JSON} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'json_ouput.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, 'json_ouput.tmpl'), loop_context_vars => TRUE, global_vars => TRUE, ); $File->{Templates}->{PrefillHTML} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'prefill_html401.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, + 'prefill_html401.tmpl'), loop_context_vars => TRUE, global_vars => TRUE, ); $File->{Templates}->{PrefillXHTML} = HTML::Template->new( %template_defaults, - filename => File::Spec->catfile($CFG->{Paths}->{Templates}, - $lang, 'prefill_xhtml10.tmpl'), + filename => catfile($CFG->{Paths}->{Templates}, $lang, + 'prefill_xhtml10.tmpl'), loop_context_vars => TRUE, global_vars => TRUE, ); @@ -694,7 +684,7 @@ $xmlparser->validation(0); $xmlparser->load_ext_dtd(0); # [NOT] loading the XML catalog for entities resolution as it seems to cause a lot of unnecessary DTD/entities fetching (requires >= 1.53 if enabled) - #$xmlparser->load_catalog( File::Spec->catfile($CFG->{Paths}->{SGML}->{Library}, 'xml.soc') ); + #$xmlparser->load_catalog(catfile($CFG->{Paths}->{SGML}->{Library}, 'xml.soc')); my $xml_string = join"\n",@{$File->{Content}}; # the XML parser will check the value of encoding attribute in XML declaration # so we have to amend it to reflect transcoding. see Bug 4867 @@ -921,7 +911,7 @@ my $parser_name = "SGML::Parser::OpenSP"; # # By default, use SGML catalog file and SGML Declaration. - my $catalog = File::Spec->catfile($CFG->{Paths}->{SGML}->{Library}, 'sgml.soc'); + my $catalog = catfile($CFG->{Paths}->{SGML}->{Library}, 'sgml.soc'); # default parsing options my @spopt = qw(valid non-sgml-char-ref no-duplicate); @@ -933,7 +923,7 @@ # # Switch to XML semantics if file is XML. if (&is_xml($File)) { - $catalog = File::Spec->catfile($CFG->{Paths}->{SGML}->{Library}, 'xml.soc'); + $catalog = catfile($CFG->{Paths}->{SGML}->{Library}, 'xml.soc'); push(@spopt, 'xml'); # workaround for a bug in s:p:o 0.99 # see http://www.w3.org/Bugs/Public/show_bug.cgi?id=798#c5
Received on Sunday, 4 January 2009 10:41:32 UTC