--------------------- PatchSet 11418 Date: 2007/05/13 13:49:56 Author: adrian Branch: HEAD Tag: (none) Log: Handle name aliases right. Members: scripts/www/build-cfg-help.pl:1.2->1.3 Index: squid/scripts/www/build-cfg-help.pl =================================================================== RCS file: /cvsroot/squid/squid/scripts/www/build-cfg-help.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- squid/scripts/www/build-cfg-help.pl 13 May 2007 12:34:31 -0000 1.2 +++ squid/scripts/www/build-cfg-help.pl 13 May 2007 13:49:56 -0000 1.3 @@ -9,7 +9,7 @@ # # Adrian Chadd # -# $Id: build-cfg-help.pl,v 1.2 2007/05/13 12:34:31 adrian Exp $ +# $Id: build-cfg-help.pl,v 1.3 2007/05/13 13:49:56 adrian Exp $ # # The template file is reasonably simple to parse. There's a number of @@ -92,7 +92,12 @@ $loc = ""; $comment = ""; $default_if_none = ""; - unshift @names, $name; + my ($r) = {}; + @{$r->{"aliases"}} = split(/ /, $1); + $r->{"name"} = $name = $r->{"aliases"}[0]; + # names should only have one entry! + shift @{$r->{"aliases"}}; + unshift @names, $r; print "DEBUG: new section: $name\n"; } elsif ($_ =~ /^COMMENT: (.*)$/) { $comment = $1; @@ -133,3 +138,14 @@ } # and now, the index file! +foreach (@names) +{ + my ($n) = $_->{"name"}; + print "name: $n\n"; + if (defined $_->{"aliases"}) { + foreach (@{$_->{"aliases"}}) { + print " alias: $_\n"; + } + } + +}