On Di. 25. Sep. 2007, 17:13:52, andreas.koenig.7os6VVqR@franz.ak.mind.de
wrote:
Show quoted text> >>>>> On Tue, 25 Sep 2007 14:43:37 -0400, "Steve Cooper via RT" <bug-
> CPAN@rt.cpan.org> said:
>
> > I updated yesterday from CPAN 1.9102 to 1.92 and now get the
> following
> > line frequently when I run CPAN:
>
> > Your OS does not support locking; continuing and ignoring all
> locking
> > issues
>
> > Everything appears to run just fine, though.
>
> Only few operations of CPAN.pm need locking: running parallel shells
> and running from parallel batch jobs and such.
>
> > How do I make that error go away?
>
> The next version will have something like this patch that will
> guarantee that the warning is only issued once:
>
> Index: lib/CPAN.pm
> ===================================================================
> --- lib/CPAN.pm (revision 2270)
> +++ lib/CPAN.pm (working copy)
> @@ -386,10 +386,12 @@
> my($fh,$mode) = @_;
> if ($Config::Config{d_flock}) {
> return flock $fh, $mode;
> - } else {
> + } elsif (!$Have_warned->{"d_flock"}++) {
> $CPAN::Frontend->mywarn("Your OS does not support locking;
> continuing and ignoring all locking issues\n");
> $CPAN::Frontend->mysleep(5);
> return 1;
> + } else {
> + return 1;
> }
> }
>
>
>
>
> Thanks for your report!
Just some info from my side:
On Solaris 10 (without having installed the ucb 'compatible' libs (=
including 'flock') I have the same 'problem' as the original poster! (I
see the warning 'Your OS does not support locking' once! (Using CPAN.pm
1.9205)
This happens, because the test 'if ($Config::Config{d_flock}) {' is wrong!
My CPAN.pm includes 'Fcntl qw(:flock)' so 'fcntl' is 'emulating' the
'flock'! So the correct test should be something like this:
if ((!$Config{'d_flock'} || $Config{'d_flock'} ne 'define') &&
(!$Config{'d_fcntl_can_lock'} || $Config{'d_fcntl_can_lock'} ne
'define')) {
then 'flock' will be called, and I don't see the the curious
error/warning message! It would be nice to see that small fix in the
next version of CPAN.pm.....