Hi Martin,
following to our discussion about the function redefinition problem in lib/cmds I'd like to provide you with the test code that I have prepared to implement solution 2).
"You like to provide me" sounds like work ;)
Currently the 'use strict' at the beginning of initServer is commented out because otherwise the daemon will not start unless all problems are corrected.
Accepted, but after the tests we have to activate "use strict".
I recommend to comment out the generalError() function call after sourcing the cmd file to see all problems (not only the first one).
Then we have to stop at the end with a generalError.
+ # FIXME/DEVELOPMENT choose the source method: + # 0: use unix cat command (dirty) + # 1: use sourcing from file handle
Why should we allow/test a dirty method? If you have clean code then we should exclusively use it.
- > + my $method = 0;
- > + if ($method == 0) {
- > + $rc = eval "use warnings FATAL => qw(redefine); " . `cat $command`;
- > + }
- > + if ($method == 1) {
+ local $/ = undef; + local *HANDLE; + open HANDLE, "<$command" and + $rc = eval "use warnings FATAL => qw(redefine); " . <HANDLE>; + close HANDLE;
- > + }
+ if ($@ or (not defined $rc)) { generalError (i18nGettext ("The loading of the command __CMD__ failed. __ERRVAL__", "__CMD__", $command, "__ERRVAL__", $@));
This we can do after all commands were loaded. It gives a huge but complete message.
Michael -- _______________________________________________________________
Michael Bell Humboldt-Universitaet zu Berlin
Tel.: +49 (0)30-2093 2482 ZE Computer- und Medienservice Fax: +49 (0)30-2093 2704 Unter den Linden 6 [EMAIL PROTECTED] D-10099 Berlin _______________________________________________________________
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
OpenCA-Devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/openca-devel