On Wed 15 Aug 2001, Paul Slootman wrote:

> When running upgrade-config.pl on a conf file that's already 2.6
> (but e.g. not 2.6d), any existing " age = " lines (in the Purge
> section) are removed:

This patch seems to fix it, although I don't really understand
where the line gets lost, and why it's necessary to output the $age_line
outside the if part...  The first change is to prevent it deleting
commented out lines (i.e. the "# <*://bar.foo.com/> age = 14" lines).

Lines numbers may be off a bit due to other changes I've been doing.


Paul Slootman


--- upgrade-config.pl.orig      Wed Aug 15 14:48:13 2001
+++ upgrade-config.pl   Wed Aug 15 15:14:28 2001
@@ -516,7 +516,7 @@
              $line="";
              print "$section\t- Resorted the option '$old_line'\n";
             }
-        elsif ($line =~ m/\s+age\s*=/)
+        elsif ($line =~ m/^[^#]*\s+age\s*=/)
             {
              $age_line = $line;
              $line='';
@@ -534,11 +534,11 @@
             {
              push(@{$options{$section}},$line);
             }
-        if ($age_line)
-            {
-             push(@{$options{$section}},$age_line);
-            }
        }
+   if ($age_line)
+       {
+        push(@{$options{$section}},$age_line);
+       }
   }
 
 # Modify the options in the configuration file.

Reply via email to