X-PMC-CI-e-mail-id: 8759
A few days ago I reported a problem of config_parse.pl, namely
it didn't explain the error caused by an incorrect default value
set inside majordomo.cf very well.
As a result, the newconfig command returns an error message which
was hard to decipher.
I then showed a very crude quick/dirty patch then, but it only worked
for a very limited set of errors namely caused by the incorrect value
assigned to default_subscribe_policy.
Now I am back to the office and here is a better patch which should
work for all problems for default value setup and an example error
message returned by majordomo is shown.
Hope this helps.
Please let me know if this is the right mailing list for reporting
the problem/bug, etc..
Chiaki Ishikawa
PATCH for config_parse.pl:
majordomo# diff -c config_parse.pl.save config_parse.pl
*** config_parse.pl.save Wed Aug 12 07:25:39 1998
--- config_parse.pl Mon Aug 17 18:13:03 1998
***************
*** 1001,1006 ****
--- 1001,1007 ----
sub grab_enum {
local($value, $list, $key) = @_;
local($i, @enum) = "";
+ local($default_value) = "";
if ($installing_defaults) { # the value when installing defaults is
# the entire enumerated list, with the
***************
*** 1008,1018 ****
--- 1009,1046 ----
@enum = split(/\001/, $value);
$value = pop(@enum);
+ $default_value = $value;
+
if ( $value =~ s/^#!// ) {
+ #
+ # kludge: $default_subscribe_policy = "closed";
+ #
+
+ $default_value = $value;
+
$value = eval("$value");
push(@errors, $@) if $@ ne "";
+
}
+ #
+ # duplicate here for better error message during
+ # default setup.
+ #
+ foreach $i (@enum) {
+ return $value if $value eq $i;
+ }
+ push(@errors, "$value at line $. is not a valid value.\n" .
+ "This value was taken from the default list.\n" .
+ "It was produced by $default_value\n" .
+ "So it is likely to be taken from majordomo.cf.\n" .
+ "BTW, the line number shown here is the line number of the last line and not relevant.\n" .
+ "The key to which the value was assigned was $key " . "\n" .
+ "Valid values are: " . join(';', @enum) . "\nlist was $list" );
+
+ return "";
+
+
} else {
@enum = split(/\001/, $known_keys{$key});
pop(@enum);
***************
*** 1021,1027 ****
return $value if $value eq $i;
}
push(@errors, "$value at line $. is not a valid value.\n" .
! "Valid values are: " . join(';', @enum) . "\n");
return "";
}
--- 1049,1059 ----
return $value if $value eq $i;
}
push(@errors, "$value at line $. is not a valid value.\n" .
! "Valid values are: " . join(';', @enum) . "\nlist was $list" .
! " the key was $key " . "\n" .
! "installing_default was $installing_defaults" . "\n");
!
!
return "";
}
======Error example: =========================
The following error was caused by incorrect value for
default_subscribe_policy: 'close' as opposed to the correct 'closed'.
This is set inisde majordomo.cf
----------------------------------------
majordomo# ed majordomo.cf
10482
/close/
$config'default_subscribe_policy = "close";
...
----------------------------------------
I sent newconfig sample foobar and received this error which
is much easier to understand now.
========================================
Date: Mon, 17 Aug 1998 18:13:17 +0900 (JST)
To: ishikawa
From: Majordomo@majordomo.yk.rim.or.jp
Subject: Majordomo results
Reply-To: Majordomo@majordomo.yk.rim.or.jp
--
>>>> newconfig sample foobar
The new config file for sample was NOT accepted because:
close at line 385 is not a valid value.
This value was taken from the default list.
It was produced by $default_subscribe_policy ? $default_subscribe_policy : 'open'
So it is likely to be taken from majordomo.cf.
BTW, the line number shown here is the line number of the last line and not relevant.
The key to which the value was assigned was subscribe_policy
Valid values are: open;closed;auto;open+confirm;closed+confirm;auto+confirm
list was sample.new>>>>
>>>>
>>>>
>>>>
>>>>
--
Ishikawa, Chiaki ishikawa@personal-media.co.jp.NoSpam or
(family name, given name) Chiaki.Ishikawa@personal-media.co.jp.NoSpam
Personal Media Corp. ** Remove .NoSpam at the end before use **
Shinagawa, Tokyo, Japan 142-0051
|
|