From: Amos Jeffries Date: Sun, 29 Oct 2023 04:12:46 +0000 (+0000) Subject: Docs: update cfgman tarball automation (#1546) X-Git-Tag: SQUID_7_0_1~310 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=560630e6deb008613db6db558fbeb8c90f3f272c;p=thirdparty%2Fsquid.git Docs: update cfgman tarball automation (#1546) Fix script issues: NOTICE: unknown line 'IF ...' NOTICE: unknown line 'ENDIF' NOTICE: unknown line 'POSTSCRIPTUM: ...' Add display of which cf.data.pre line each such NOTICE (and some debugs) was found on. Add missing HAVE_AUTH_* definitions. Fix case typo of if/endif so regex can detect it. Also, fix indentation typo in 'acl' directive texts. --- diff --git a/scripts/www/build-cfg-help.pl b/scripts/www/build-cfg-help.pl index e15ead1575..d908bef2ef 100755 --- a/scripts/www/build-cfg-help.pl +++ b/scripts/www/build-cfg-help.pl @@ -247,6 +247,7 @@ sub update_defaults() } } +my @ifelse = (); while (<>) { chomp; last if (/^EOF$/); @@ -267,8 +268,28 @@ while (<>) { $data->{'default_doc'} = ""; $data->{'default_if_none'} = ""; - print "DEBUG: new option: $name\n" if $verbose; + print "DEBUG: line $.: new option: $name\n" if $verbose; next; + } elsif ($_ =~ /^IF (.*)$/) { + my $cond = $1; + push(@ifelse, "$.: $1"); + if (! defined $defines{$1}) { + print "NOTICE: line $.: unknown ./configure option '$1'\n"; + } else { + $cond = $defines{$1}; + } + if ($state eq "doc") { + $data->{"doc"} .= "if " . $cond . "\n"; + } elsif ($state eq "comment") { + $comment .= "if " . $cond . "\n"; + } + } elsif ($_ =~ /^ENDIF$/) { + pop(@ifelse); + if ($state eq "doc") { + $data->{"doc"} .= "endif\n"; + } elsif ($state eq "comment") { + $comment .= "endif\n"; + } } elsif ($_ =~ /^COMMENT: (.*)$/) { $data->{"comment"} = $1; } elsif ($_ =~ /^TYPE: (.*)$/) { @@ -280,6 +301,11 @@ while (<>) { } else { $data->{"default"} .= "$name $1\n"; } + } elsif ($_ =~ /^POSTSCRIPTUM: (.*)$/) { + if ($data->{"default"} eq "none") { + $data->{"default"} = ""; + } + $data->{"default"} .= "$name $1\n"; } elsif ($_ =~ /^DEFAULT_DOC: (.*)$/) { $data->{"default_doc"} .= "$1\n"; } elsif ($_ =~ /^DEFAULT_IF_NONE: (.*)$/) { @@ -323,9 +349,12 @@ while (<>) { } elsif (/^#/) { next; } elsif ($_ ne "") { - print "NOTICE: unknown line '$_'\n"; + print "NOTICE: line $.: unknown line '$_'\n"; } } +foreach my $condition (@ifelse) { + print "ERROR: missing ENDIF to match $condition\n"; +} end_options; print $index "

Alphabetic index

\n" if $format eq "splithtml"; print $index "

Alphabetic index

\n" if $format eq "singlehtml"; diff --git a/src/cf.data.pre b/src/cf.data.pre index 33b6ed3252..117ca0d157 100644 --- a/src/cf.data.pre +++ b/src/cf.data.pre @@ -1128,7 +1128,7 @@ DOC_START acl aclname dst [-n] ip-address/mask ... # URL host's IP address [slow] acl aclname localip ip-address/mask ... # IP address the client connected to [fast] -if USE_SQUID_EUI +IF USE_SQUID_EUI acl aclname arp mac-address ... acl aclname eui64 eui64-address ... # [fast] @@ -1148,7 +1148,7 @@ if USE_SQUID_EUI # # IPv6 protocol does not contain ARP. MAC/EUI is either # encoded directly in the IPv6 address or not available. -endif +ENDIF acl aclname clientside_mark mark[/mask] ... # matches CONNMARK of an accepted connection [fast] # DEPRECATED. Use the 'client_connection_mark' instead. @@ -1500,7 +1500,7 @@ endif # acl hasWhatMyLoggingDaemonNeeds has request # acl hasWhatMyLoggingDaemonNeeds has response -acl aclname at_step step + acl aclname at_step step # match against the current request processing step [fast] # Valid steps are: # GeneratingCONNECT: Generating HTTP CONNECT request headers diff --git a/src/cf_gen_defines b/src/cf_gen_defines index 3d84cf60ed..5b070eef1c 100644 --- a/src/cf_gen_defines +++ b/src/cf_gen_defines @@ -24,6 +24,8 @@ BEGIN { define["FOLLOW_X_FORWARDED_FOR&&LINUX_NETFILTER"]="--enable-follow-x-forwarded-for and --enable-linux-netfilter" define["FOLLOW_X_FORWARDED_FOR&&USE_ADAPTATION"]="--enable-follow-x-forwarded-for and (--enable-icap-client and/or --enable-ecap)" define["FOLLOW_X_FORWARDED_FOR&&USE_DELAY_POOLS"]="--enable-follow-x-forwarded-for and --enable-delay-pools" + define["HAVE_AUTH_MODULE_BASIC"]="--enable-auth-basic" + define["HAVE_AUTH_MODULE_DIGEST"]="--enable-auth-digest" define["HAVE_MSTATS&&HAVE_GNUMALLOC_H"]="GNU Malloc with mstats()" define["ICAP_CLIENT"]="--enable-icap-client" define["SO_MARK&&USE_LIBCAP"]="Packet MARK (Linux)"