Author: krejzi
Date: Wed Jun 17 23:15:34 2015
New Revision: 16136

Log:
Fix  gtk-doc detection.

Modified:
   trunk/scripts/blfs-chapter11.php

Modified: trunk/scripts/blfs-chapter11.php
==============================================================================
--- trunk/scripts/blfs-chapter11.php    Wed Jun 17 14:33:56 2015        (r16135)
+++ trunk/scripts/blfs-chapter11.php    Wed Jun 17 23:15:34 2015        (r16136)
@@ -75,6 +75,12 @@
   // Check for ftp
   if ( preg_match( "/^ftp/", $dirpath ) ) 
   { 
+
+    // Get listing
+    $lines = http_get_file( "$dirpath/" );
+  }
+  else // http
+  {
     // glib type packages
     if ( $book_index == "gtk-doc" )
     {
@@ -82,8 +88,8 @@
       $dirpath  = rtrim  ( $dirpath, "/" );    // Trim any trailing slash
       $position = strrpos( $dirpath, "/" );
       $dirpath  = substr ( $dirpath, 0, $position );
-      $lines    = http_get_file( "$dirpath/" );
-      $dir      = find_max( $lines, '/^[\d\.]+$/', '/^([\d\.]+)$/' );
+      $lines    = http_get_file( $dirpath );
+      $dir      = find_max( $lines, '/^\s+[\d\.]+\//', '/^\s+([\d\.]+)\/.*$/' 
);
       $dirpath .= "/$dir/";
     }
 
@@ -94,16 +100,11 @@
       $dirpath  = rtrim  ( $dirpath, "/" );    // Trim any trailing slash
       $position = strrpos( $dirpath, "/" );
       $dirpath  = substr ( $dirpath, 0, $position );
-      $lines    = http_get_file( "$dirpath/" );
-      $dir = find_max( $lines, "/\d[\d\.]+/", "/(\d[\d\.]+)/" );
+      $lines    = http_get_file( $dirpath );
+      $dir      = find_max( $lines, '/^\s+[\d\.]+\//', '/^\s+([\d\.]+)\/.*$/' 
);
       $dirpath .= "/$dir/";
     }
 
-    // Get listing
-    $lines = http_get_file( "$dirpath/" );
-  }
-  else // http
-  {
     // Customize http directories as needed
      $lines = http_get_file( $dirpath );
      if ( ! is_array( $lines ) ) return $lines;
-- 
http://lists.linuxfromscratch.org/listinfo/blfs-book
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to