"(Andreas J. Koenig) via RT" <bug-CPAN@rt.cpan.org> writes:
Show quoted text> <URL:
http://rt.cpan.org/Ticket/Display.html?id=29754 >
>
> >>>>> On Wed, 03 Oct 2007 18:07:35 -0400, "Slaven_Rezic via RT" <bug-CPAN@rt.cpan.org> said:
>
> > Wed Oct 03 18:07:33 2007: Request 29754 was acted upon.
> > Transaction: Ticket created by SREZIC
> > Queue: CPAN
> > Subject: Lockfile problem with perl 5.005_05
> > Broken in: (no value)
> > Severity: Unimportant
> > Owner: Nobody
> > Requestors: SREZIC@cpan.org
> > Status: new
> > Ticket <URL:
http://rt.cpan.org/Ticket/Display.html?id=29754 >
>
>
> > (Using CPAN.pm from SVN)
>
> > If another CPAN shell is running, another shell cannot be started. The
> > error message is:
>
> > $ /usr/perl5.005_05/bin/perl -MCPAN -eshell
> > CPAN: File::HomeDir loaded ok (v0.66)
> > CPAN: Term::ANSIColor loaded ok (v1.12)
> > CPAN.pm panic: Found invalid lockfile '/usr/local/src/CPAN/.lock',
> > please remove. Cannot proceed.
>
> Did you remove it and retry? I'm not sure but maybe it leads us to a clue?
>
It seems to be indeed a flushing problem. The truss output shows no
write to the lock file until to the very end of the shell lifetime.
With this change:
Index: lib/CPAN.pm
===================================================================
--- lib/CPAN.pm (Revision 2305)
+++ lib/CPAN.pm (Arbeitskopie)
@@ -1113,6 +1113,7 @@
seek $fh, 0, 0;
truncate $fh, 0;
+ $fh->autoflush(1);
$fh->print($$, "\n");
$fh->print(hostname(), "\n");
$self->{LOCK} = $lockfile;
the problem goes away. For some reason this problem does not occur
with newer perls, but maybe this is some difference due to perlio vs.
stock stdio.
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
tkruler - Perl/Tk program for measuring screen distances
http://ptktools.sourceforge.net/#tkruler