Mantis - pkg_get
Viewing Issue Advanced Details
3477 regular use minor always 2009-03-20 19:06 2009-03-24 10:33
iddecker  
bonivart  
normal  
closed  
1.5b3 fixed  
none    
none  
0003477: catalog is always updated if catalog on mirror is old
when the catalog on the mirror is older than 14 days, the catalog is always updated, because the downloaded catalog file is older than 14 days
use a stable mirror (eg http://ftp.heanet.ie/pub/opencsw/stable) [^]
solution: touch catalog after download

patch:

--- /opt/csw/bin/pkgutil 2009-03-19 14:16:33.000000000 +0100
+++ pkgutil_ 2009-03-20 19:01:54.083912137 +0100
@@ -66,9 +66,9 @@
 
 sub check_catalog {
   my($always) = @_;
- my $age = 0;
 
   foreach my $url (@mirror) {
+ my $age = 0;
     my $filename = mangle_url($url);
     my $age_i = -M $filename if (-r $filename);
     $age = $age_i if defined($age_i) && $age_i > $age;
@@ -192,6 +192,7 @@
   } else {
     $status = system("$wget $wgetopts -O $filename $url/catalog");
   }
+ system("touch $filename");
   if ($status) {
     print "\nFetching of catalog failed.\n";
     exit 1;
Issue History
2009-03-20 19:06 iddecker New Issue
2009-03-23 15:08 bonivart Status new => assigned
2009-03-23 15:08 bonivart Assigned To => bonivart
2009-03-23 15:09 bonivart Note Added: 0005696
2009-03-23 21:00 bonivart Note Added: 0005713
2009-03-24 10:33 bonivart Note Added: 0005718
2009-03-24 10:33 bonivart Status assigned => closed
2009-03-24 10:33 bonivart Resolution open => fixed

Notes
(0005696)
bonivart   
2009-03-23 15:09   
I can see that this is a problem if you use the stable catalog which doesn't change often, then you will have to download it every time anyway. I will fix this. Thanks for letting me know.
(0005713)
bonivart   
2009-03-23 21:00   
I have committed a change into svn (r14).
(0005718)
bonivart   
2009-03-24 10:33   
The fix has been tested and will be in v1.5.