]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Docs: update cfgman tarball automation (#1546)
authorAmos Jeffries <yadij@users.noreply.github.com>
Sun, 29 Oct 2023 04:12:46 +0000 (04:12 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 29 Oct 2023 06:33:17 +0000 (06:33 +0000)
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.

scripts/www/build-cfg-help.pl
src/cf.data.pre
src/cf_gen_defines

index e15ead1575c636a508af1f9d9eb62f5668d5537c..d908bef2ef78fa033973cd21eee77239bc65bae8 100755 (executable)
@@ -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 "<p><a href=\"index_all.html\">Alphabetic index</a></p>\n" if $format eq "splithtml";
 print $index "<p><a href=\"#index\">Alphabetic index</a></p>\n" if $format eq "singlehtml";
index 33b6ed3252f1a9d2648f8fee6aebca0b056d6a12..117ca0d157366e98408445e37fb949627d9f06e3 100644 (file)
@@ -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
index 3d84cf60ed41854edb2dbf300fc25ca664b46ad7..5b070eef1c5e4039af3d0d9705981da98a3771a1 100644 (file)
@@ -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)"