Update of /cvsroot/fink/fink
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7168

Modified Files:
        ChangeLog postinstall.pl.in 
Log Message:
make scanpackages run on postinstall, when it's the first time the user is 
running with AutoScanpackages

Index: postinstall.pl.in
===================================================================
RCS file: /cvsroot/fink/fink/postinstall.pl.in,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- postinstall.pl.in   3 Jan 2006 20:14:46 -0000       1.36
+++ postinstall.pl.in   29 Mar 2006 23:00:43 -0000      1.37
@@ -30,7 +30,7 @@
 use lib "@PREFIX@/lib/perl5";
 
 use Fink::Bootstrap qw(&check_host);
-use Fink::Services qw(&read_config &execute);
+use Fink::Services qw(&read_config &execute &apt_available);
 use Fink::CLI qw(&print_breaking &prompt_boolean);
 
 use Fink::Config qw($config);
@@ -237,6 +237,26 @@
  
 }
 
+# If a user upgrades to a new fink with AutoScanpackages, we'd rather do the
+# first (uncached, long) scan in postinst than at the end of the user's next
+# build.
+sub pre_scanpackages {
+       my $autoscan = !$config->has_param("AutoScanpackages")
+               || $config->param_boolean("AutoScanpackages");
+       return 0 unless $autoscan && apt_available;
+
+       require Fink::Scanpackages;
+       my $cache = Fink::Scanpackages->default_cache;
+       return 0 if -e $cache; # we already ran scanpackages at some point
+       
+       print STDERR "Caching your binary packages...this may take a while.\n";
+       
+       # Don't use the PDB, we don't want to trigger an index now
+       require Fink::Engine;
+       Fink::Engine::scanpackages({ pdb => 0 });
+       return 1;
+}
+pre_scanpackages();
 
 if ($configNeedsUpdate) {
   &print_breaking("\nThis fink version introduces new settings stored in the " 
.

Index: ChangeLog
===================================================================
RCS file: /cvsroot/fink/fink/ChangeLog,v
retrieving revision 1.417
retrieving revision 1.418
diff -u -d -r1.417 -r1.418
--- ChangeLog   28 Mar 2006 20:01:27 -0000      1.417
+++ ChangeLog   29 Mar 2006 23:00:43 -0000      1.418
@@ -1,3 +1,9 @@
+2006-03-29  Dave Vasilevsky  <[EMAIL PROTECTED]>
+
+       * postinstall.pl.in: If AutoScanpackages is about to be turned on for 
the
+       first time, pre-scan the user's debs rather than surprising them at the
+       end of the next build.
+
 2006-03-28  Daniel Macks  <[EMAIL PROTECTED]>
 
        * bootstrap.pl: FinkVersion.pm::default_binary_version now returns



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Fink-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fink-commits

Reply via email to