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

Modified Files:
      Tag: branch-interactive-update
        Engine.pm 
Log Message:
interactive update

Index: Engine.pm
===================================================================
RCS file: /cvsroot/fink/fink/perlmod/Fink/Engine.pm,v
retrieving revision 1.395
retrieving revision 1.395.2.1
diff -u -d -r1.395 -r1.395.2.1
--- Engine.pm   11 Jan 2007 03:17:47 -0000      1.395
+++ Engine.pm   22 Jan 2007 01:59:47 -0000      1.395.2.1
@@ -1581,7 +1581,32 @@
                        $deb_from_binary_dist = 1;
                }
        }
-               
+
+       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;
+               if (-f $cache_file)
+               {
+                       $up_to_date = "WARNING: your info file cache has not 
been updated for " . int(-M $cache_file) . " days.";
+               } else {
+                       $up_to_date = "WARNING: your info file cache does not 
exist.";
+               }
+
+               if ($oldindexes eq "warn") {
+                       print_breaking_stderr $up_to_date . "  You should run 
'fink selfupdate' to get the latest package descriptions.\n";
+               } elsif ($oldindexes eq "update") {
+                       print_breaking_stderr $up_to_date . "  Fink will now 
update it automatically.";
+                       require Fink::SelfUpdate;
+                       Fink::SelfUpdate::check();
+               }
+       }
+
        # add requested packages
        foreach $pkgspec (@_) {
                # resolve package name


-------------------------------------------------------------------------
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