--- toast	2004/02/21 04:36:07	1.297
+++ toast	2004/02/21 06:27:07	1.298
@@ -1911,6 +1911,9 @@
     {
       seek(FILE, 0, 0) || error("rewind $file: $!");
       my(@links) = reverse(sort cmpab linksfromstream(*FILE, $url));
+      my(@goodlinks) = grep(/\.tar\./, @links);
+      @goodlinks = grep(!/\.(s?html?|php)$/i, @links) unless @goodlinks;
+      @links = @goodlinks if @goodlinks;
       for (@links)
       {
         $redir = $_ if !$redir && basename(stripquery($_)) eq $basename
@@ -2595,9 +2598,16 @@
     }
   }
 
+  for(qw[build_unix build.unix]) # e.g. Sleepycat DB and nvi, respectively
+  {
+    my($bubuilddir) = path($dir, $_);
+    my($buconfprog) = path($dir, "dist", "configure");
+    return $bubuilddir if -d($bubuilddir) && -x($buconfprog) &&
+        cdrun($bubuilddir, "../dist/configure", "--prefix=$prefix");
+  }
+
   # configure script might be hidden in a "source" subdirectory (e.g. samba)
-  # or a "dist" subdirectory (e.g. nvi)
-  for(qw[source src dist])
+  for(qw[source src])
   {
     my($subdir) = path($dir, $_);
     my($confprog) = path($subdir, "configure");
@@ -2686,12 +2696,6 @@
     sub { true }
   );
 
-  # Sleepycat DB appears to demand the following in Unix-like environments:
-  my($dbbuilddir) = path($dir, "build_unix");
-  my($dbconfprog) = path($dir, "dist", "configure");
-  return $dbbuilddir if -d($dbbuilddir) && -x($dbconfprog) &&
-      cdrun($dbbuilddir, "../dist/configure", "--prefix=$prefix");
-
   # Maybe there's just an install script of some kind that we need to run.
   # Create an appropriate Makefile.
   for(qw[install.sh INSTALL install.pl])
@@ -5891,7 +5895,6 @@
 
 Known bugs:
 
-  - Berkeley/Sleepycat DB is broken again
   - autofind hangs in httphead() when going through tinyproxy?
   - autofind mishandles http redirects (e.g. http://toastball.net/toast)
   - gtk+ doesn't seem to build properly when it is already armed