[PATCH] v2 upgrade process for obsolete options

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Sun, 17 Oct 2010 02:22:52 +1300

After Alex suggestion/request the DOC_* comments can be used to
hard-code the upgrade process documentation in cf.data.pre instead of
cache_cf.cc.

In total:

  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 pumps old config lines off to a
parse_obsolete() function for handling without causing the directives to
remain in the publicly visible squid.conf documentation.

  cf.data.pre has entries added for all the 2.6-3.1 directives I could
find that were removed up to 3.HEAD

  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 it is displayed at debug level 0 otherwise it's
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
option 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.

  One useful side-effect was the removal of some LOC: assert(). This
allows directives to be configured with no LOC: entry being identical to
a previously explicit "LOC: none".

Amos

-- 
Please be using
   Current Stable Squid 2.7.STABLE9 or 3.1.8
   Beta testers wanted for 3.2.0.2

Received on Sat Oct 16 2010 - 13:22:58 MDT

This archive was generated by hypermail 2.2.0 : Wed Oct 20 2010 - 12:00:05 MDT