Skip Menu |

This queue is for tickets about the CPAN CPAN distribution.

Report information
The Basics
Id: 107187
Status: open
Priority: 0/
Queue: CPAN

People
Owner: Nobody in particular
Requestors: dolmen [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 2.10
Fixed in: (no value)



Subject: CPAN does not auto-updates its cache for file:// mirrors


I'm using a minicpan.
I've pointed my urllist to using a file:// URL.
I have cache_metadata set to 1.

When I update my minicpan and then enter the CPAN shell, it seems that the shell does not detect the update and still use an old version of the index when using an install command.
So I have to manually 'reload' the index ("reload index" command) to fix the issue.




-- 
Olivier Mengué - http://perlresume.org/DOLMEN
On 2015-09-19 02:40:04, DOLMEN wrote: Show quoted text
> I'm using a minicpan. > I've pointed my urllist to using a file:// URL. > I have cache_metadata set to 1. > > When I update my minicpan and then enter the CPAN shell, it seems that > the > shell does not detect the update and still use an old version of the > index when > using an install command. > So I have to manually 'reload' the index ("reload index" command) to > fix the > issue.
I guess that a workaround could be to set index_expire=>0. But this would probably mean that the metadata is rebuilt every time, even if there are no changes. So detecting a modified file would be better. And likewise for http, implementing something using If-Modified-Since to detect modified remote files would also be good.
Subject: Re: [rt.cpan.org #107187] CPAN does not auto-updates its cache for file:// mirrors
Date: Sun, 20 Sep 2015 04:29:15 +0200
To: bug-CPAN [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Sat, 19 Sep 2015 15:02:54 -0400, "Slaven_Rezic via RT" <bug-CPAN@rt.cpan.org> said:
Show quoted text
>> I'm using a minicpan. >> I've pointed my urllist to using a file:// URL. >> I have cache_metadata set to 1. >> >> When I update my minicpan and then enter the CPAN shell, it seems that >> the >> shell does not detect the update and still use an old version of the >> index when >> using an install command. >> So I have to manually 'reload' the index ("reload index" command) to >> fix the >> issue.
Show quoted text
> I guess that a workaround could be to set index_expire=>0. But this > would probably mean that the metadata is rebuilt every time, even if > there are no changes. So detecting a modified file would be better. > And likewise for http, implementing something using > If-Modified-Since to detect modified remote files would also be > good.
FWIW, where I use a file:// URL, I usually set 'index_expire' => q[0.1], I've never had the desire that my cpan shell gets informed faster than that. I usually read the recent files from elsewhere and type "reload index" when the cpan shell does know about one of them. -- andreas
As I manually re-fetch my minicpan from my Unix shell with an alias, my best workaround seems to reload the index in the process.

Here is my new alias:
    alias minicpan='minicpan -c CPAN::Mini::LatestDistVersion; perl -MCPAN -e "CPAN::Index->force_reload"'

-- 
Olivier Mengué - http://perlresume.org/DOLMEN