+#
+# Replace --devices with -D in RsyncArgs and RsyncRestoreArgs
+#
+foreach my $param ( qw(RsyncArgs RsyncRestoreArgs) ) {
+ next if ( !defined($newVars->{$param}) );
+ $newConf->[$newVars->{$param}]{text} =~ s/--devices/-D/g;
+}
+
+#
+# Merge any new user-editable parameters into CgiUserConfigEdit
+# by copying the old settings forward.
+#
+if ( defined($Conf{CgiUserConfigEdit}) ) {
+ #
+ # This is a real hack. The config file merging is done in text
+ # form without actually instantiating the new conf structure.
+ # So we need to extract the new hash of settings, update it,
+ # and merge the text. Ugh...
+ #
+ my $new;
+ my $str = $distConf->[$distVars->{CgiUserConfigEdit}]{text};
+
+ $str =~ s/^\s*\$Conf\{.*?\}\s*=\s*/\$new = /m;
+ eval($str);
+ foreach my $p ( keys(%$new) ) {
+ $new->{$p} = $Conf{CgiUserConfigEdit}{$p}
+ if ( defined($Conf{CgiUserConfigEdit}{$p}) );
+ }
+ $Conf{CgiUserConfigEdit} = $new;
+ my $d = Data::Dumper->new([$new], [*value]);
+ $d->Indent(1);
+ $d->Terse(1);
+ my $value = $d->Dump;
+ $value =~ s/(.*)\n/$1;\n/s;
+ $newConf->[$newVars->{CgiUserConfigEdit}]{text}
+ =~ s/(\s*\$Conf\{.*?\}\s*=\s*).*/$1$value/s;
+}
+
+#
+# Now backup and write the config file
+#