- From: Olivier Thereaux via cvs-syncmail <cvsmail@w3.org>
- Date: Tue, 08 Jul 2008 16:16:44 +0000
- To: www-validator-cvs@w3.org
Update of /sources/public/2002/css-validator/scripts In directory hutz:/tmp/cvs-serv22615/scripts Modified Files: menu.pl Log Message: fixing small bugs in the lang menu script Index: menu.pl =================================================================== RCS file: /sources/public/2002/css-validator/scripts/menu.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- menu.pl 8 Jul 2008 15:59:57 -0000 1.2 +++ menu.pl 8 Jul 2008 16:16:42 -0000 1.3 @@ -5,7 +5,6 @@ my $cwdir = getcwd; my $menuline; my @langs; -my $replaced = 0; open (menu_template, "menu.tmpl") or die("could not open menu template file"); while ($menuline = <menu_template>) { $newmenu .= $menuline; @@ -19,7 +18,6 @@ my $html = ""; foreach my $filename (@files) { foreach my $ext (@langs) { - $replaced = 0; $html = ''; if (open (HTML, "../$filename.$ext")) { print "reading ../$filename.$ext\n"; @@ -29,14 +27,9 @@ close(HTML); my $html_orig = $html; $html =~ s/(<ul id="lang_choice">.*?<\/ul>)/$newmenu/sgmi; - if ($html ne $html_orig) { $replaced = 1;} - $html =~ s/($filename)/$filename/sgmi; - if (!$replaced) { - print "did not replace menu in $filename.$ext\n"; - } + $html =~ s/\$filename/$filename/gi; open (HTML, ">../$filename.$ext"); - #print "writing to ../$filename.$ext\n"; - print "\n"; + print HTML $html; close HTML; }
Received on Tuesday, 8 July 2008 16:17:18 UTC