]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 143040 - Tidy up remove parameters message in checksetup.pl. Patch by gerv; r...
authorgerv%gerv.net <>
Thu, 9 May 2002 06:20:22 +0000 (06:20 +0000)
committergerv%gerv.net <>
Thu, 9 May 2002 06:20:22 +0000 (06:20 +0000)
checksetup.pl
defparams.pl

index 1883a53241ce74d6ec8328153d15b2ff5773172c..62386fca6ce3f522430fe347a6cb26978997128c 100755 (executable)
@@ -903,22 +903,27 @@ if (-e "data/params") {
     require "data/params";
     require "defparams.pl";
     use vars @::param_list;
+    my @oldparams;
+    
     open(PARAMFILE, ">>old-params.txt") 
       || die "$0: Can't open old-params.txt for writing: $!\n";
       
     foreach my $item (keys %::param) {
         if (!grep($_ eq $item, @::param_list) && $item ne "version") {
-            print "The $item parameter is no longer used in Bugzilla,
-                   so it has been removed from your parameters file and
-                   written to old-params.txt.\n";
-            
-            print PARAMFILE "\n\n$item:\n";
-            print PARAMFILE $::param{$item};
+            push (@oldparams, $item);
+            print PARAMFILE "\n\n$item:\n$::param{$item}\n";
                 
             delete $::param{$item};
         }
     }
     
+    if (@oldparams) {
+        print "The following parameters are no longer used in Bugzilla, " .
+              "and so have been\nremoved from your parameters file and " .
+              "appended to old-params.txt:\n";
+        print join(", ", @oldparams) . "\n\n";               
+    }
+    
     close PARAMFILE;
     WriteParams();
 }
index 2c6b8b889d385be471b5be8adb6ad834a70b7cc2..fbd9631d2f43de05cc3a72d4aa4d113b086c11d1 100644 (file)
@@ -54,16 +54,7 @@ sub WriteParams {
             }
         }
     }
-    # If Bugzilla has been upgraded since the last time parameters were edited,
-    # and some parameters have been removed in the new version of Bugzilla,
-    # remove them from the parameters file.
-    foreach my $item (keys %::param) {
-        if (!grep($_ eq $item, @::param_list) && $item ne "version") {
-            print "The <em>$item</em> parameter is no longer used in Bugzilla
-              and has been removed from your parameters file.<br>";
-            delete $::param{$item};
-        }
-    }
+
     my $tmpname = "data/params.$$";
     open(FID, ">$tmpname") || die "Can't create $tmpname";
     my $v = $::param{'version'};