]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
config: settings-get.pl - Remove ifdef handling for services
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Sat, 20 May 2023 21:14:29 +0000 (00:14 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 20 Nov 2023 12:22:31 +0000 (14:22 +0200)
This was necessary only for tcpwrap service, which was already removed.

src/config/settings-get.pl

index f275c9a278deecf1367fc6821935f181f6dad6e2..731ddf9c8aa7821a1c2d212c06cec5ce3ed94116 100755 (executable)
@@ -30,7 +30,6 @@ print '#define CONFIG_BINARY'."\n";
 
 my @services = ();
 my %service_defaults = ();
-my @service_ifdefs = ();
 my %parsers = ();
 
 my $linked_file = 0;
@@ -48,8 +47,6 @@ foreach my $file (@ARGV) {
   my $code = "";
   my %funcs;
   my $cur_name = "";
-  my $ifdef = "";
-  my $state_ifdef = 0;
   
   while (<$f>) {
     my $write = 0;
@@ -60,14 +57,7 @@ foreach my $file (@ARGV) {
        $state++;
       } elsif (/^struct service_settings (.*) = \{/) {
        $state++;
-       if ($ifdef eq "") {
-         $state_ifdef = 0;
-       } else {
-         $_ = $ifdef."\n".$_;
-         $state_ifdef = 1;
-       }
        push @services, $1;
-       push @service_ifdefs, $ifdef;
       } elsif (/^const struct setting_keyvalue (.*_defaults)\[\] = \{/) {
         $service_defaults{$1} = 1;
         $state++;
@@ -86,12 +76,6 @@ foreach my $file (@ARGV) {
        $code .= $_;
       }
       
-      if (/(^#ifdef .*)$/ || /^(#if .*)$/) {
-       $ifdef = $1;
-      } else {
-       $ifdef = "";
-      }
-      
       if (/#define.*DEF/ || /^#undef.*DEF/ || /ARRAY_DEFINE_TYPE.*_settings/) {
        $write = 1;
        $state = 2 if (/\\$/);
@@ -111,10 +95,6 @@ foreach my $file (@ARGV) {
       if (/};/) {
        $state = 0;
        $cur_name = "";
-       if ($state_ifdef) {
-         $_ .= "#endif\n";
-         $state_ifdef = 0;
-       }
       }
     }
   
@@ -139,14 +119,11 @@ sub service_name {
 print "static const struct config_service config_default_services[] = {\n";
 @services = sort { service_name($a) cmp service_name($b) } @services;
 for (my $i = 0; $i < scalar(@services); $i++) {
-  my $ifdef = $service_ifdefs[$i];
-  print "$ifdef\n" if ($ifdef ne "");
   my $defaults = "NULL";
   if (defined($service_defaults{$services[$i]."_defaults"})) {
     $defaults = $services[$i]."_defaults";
   }
   print "\t{ &".$services[$i].", $defaults },\n";
-  print "#endif\n" if ($ifdef ne "");
 }
 print "\t{ NULL, NULL }\n";
 print "};\n";