Update of /cvsroot/fink/fink/perlmod/Fink
In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv14806/perlmod/Fink

Modified Files:
        ChangeLog Engine.pm 
Log Message:
warn if indexes are out of date

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.396
retrieving revision 1.397
diff -u -d -r1.396 -r1.397
--- Engine.pm   22 Jan 2007 02:35:09 -0000      1.396
+++ Engine.pm   23 Jan 2007 18:57:03 -0000      1.397
@@ -1583,7 +1583,36 @@
                        $deb_from_binary_dist = 1;
                }
        }
-               
+
+       # don't bother doing this on point release, of course it's out-of-date  
;)
+       if ($config->param("SelfUpdateMethod") ne "point")
+       {
+               my $cache_file = Fink::Scanpackages->default_cache;
+               if (not -f $cache_file or (-M $cache_file > 14)) {
+                       my $oldindexes = 
lc(Fink::Config::get_option("OldIndexes", "warn"));
+                       if ($oldindexes !~ /^(ignore|update|warn)$/) {
+                               $oldindexes = 'warn';
+                               print_breaking_stderr "WARNING: unknown value 
for 'OldIndexes' in fink.conf: $oldindexes";
+                       }
+       
+                       my $up_to_date_text;
+                       if (-f $cache_file)
+                       {
+                               $up_to_date_text = "WARNING: your info file 
index has not been updated for " . int(-M $cache_file) . " days.";
+                       } else {
+                               $up_to_date_text = "WARNING: your info file 
index does not exist.";
+                       }
+       
+                       if ($oldindexes eq "warn") {
+                               print_breaking_stderr $up_to_date_text . "  You 
should run 'fink selfupdate' to get the latest package descriptions.\n";
+                       } elsif ($oldindexes eq "update") {
+                               print_breaking_stderr $up_to_date_text . "  
Fink will now update it automatically.";
+                               require Fink::SelfUpdate;
+                               Fink::SelfUpdate::check();
+                       }
+               }
+       }
+
        # add requested packages
        foreach $pkgspec (@_) {
                # resolve package name

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/ChangeLog,v
retrieving revision 1.1427
retrieving revision 1.1428
diff -u -d -r1.1427 -r1.1428
--- ChangeLog   23 Jan 2007 04:02:05 -0000      1.1427
+++ ChangeLog   23 Jan 2007 18:57:03 -0000      1.1428
@@ -1,3 +1,8 @@
+2007-01-23  Benjamin Reed  <[EMAIL PROTECTED]>
+
+       * PkgVersion.pm: Automatically update (or warn) if index is
+       out of date
+
 2007-01-22  Daniel Macks  <[EMAIL PROTECTED]>
 
        * PkgVersion.pm: Make sure explicit --logfile can be written.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Fink-commits mailing list
Fink-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to