From: Amos Jeffries Date: Sat, 23 Oct 2010 08:50:56 +0000 (-0600) Subject: Upgrade process for obsolete options X-Git-Tag: take1~153 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76f4448105619e1cefe1af8437604d2ea9a8e886;p=thirdparty%2Fsquid.git Upgrade process for obsolete options One problem we currently have with upgrades is leaving the parser able to avoid its bungled/unknown option message for directives which have been fully removed or massively syntax altered. We are able to handle this for flags and option syntax easily but the parser has been particularly dense and strict on the directives (first word of each line). This patch updates the cf_* and cfgman code to allow a special directive type "obsolete" which causes these directives to be handled specially without causing the directives to remain in the publicly visible squid.conf documentation. It allows DOC_START / DOC_END comments to be written in cf.data.pre describing the upgrade actions that need to be taken. This text is dumped to cache.log verbatim when the configuration option is sighted. If "-k parse" is used the text is displayed at debug level 0, otherwise displayed at debug level 1. One line indicating a generic "directive X is obsolete" is always displayed at level 0 for backwards compatibility with admin expectations of a high level "bungled" message. After all this text display, parse_obsolete(char*) is called with the directive name. This function exists in cache_cf.cc and can be coded to selectivey do more complex handling of the directive. ie for upgrade actions deeper than removal. * cf.data.pre has entries added for all the 2.6-3.1 directives I could find that were removed up to 3.HEAD --- diff --git a/scripts/www/build-cfg-help.pl b/scripts/www/build-cfg-help.pl index caefc1a224..44f23d3371 100755 --- a/scripts/www/build-cfg-help.pl +++ b/scripts/www/build-cfg-help.pl @@ -305,6 +305,7 @@ print $index "
\n" if $format eq "singlehtml"; # and now, build the option pages my (@names) = keys %option; foreach $name (@names) { + next if $option{$name}->{'type'} eq "obsolete"; generate_page("${top}/${pagetemplate}", $option{$name}); } @@ -350,6 +351,7 @@ print $fh "