Author: bdubbs
Date: Wed Feb  8 09:01:09 2017
New Revision: 18273

Log:
Fix script for stupid inkscape web site

Modified:
   trunk/scripts/blfs-chapter43.php

Modified: trunk/scripts/blfs-chapter43.php
==============================================================================
--- trunk/scripts/blfs-chapter43.php    Wed Feb  8 08:13:56 2017        (r18272)
+++ trunk/scripts/blfs-chapter43.php    Wed Feb  8 09:01:09 2017        (r18273)
@@ -17,10 +17,10 @@
 
 $libreoffice = array();
 
-//$current="firefox";
+//$current="inkscape";
 
 $regex = array();
-$regex[ 'inkscape'     ] = "/^.*Latest stable.*(\d[\d\.]+\d).*$/";
+//$regex[ 'inkscape'     ] = "/^.*Latest stable.*(\d[\d\.]+\d).*$/";
 //$regex[ 'chromium'     ] = "/^.*stable.*updated to (\d[\d\.]+\d) for 
Windows.*$/";
 $regex[ 'chromium'     ] = "/^pkgver=(\d[\d\.]+\d).*$/";
 $regex[ 'gnucash'      ] = "/^.*Download gnucash-(\d[\d\.]+\d).tar.*$/";
@@ -244,8 +244,22 @@
      return 0;  // This is an error
   }
 
-  #if ( preg_match( "/inkscape/", "$dirpath" ) )
-  #    return find_max( $lines, "/inkscape-/", 
"/^.*inkscape-(\d[\d\.]+\d).tar.*$/" );
+  if ( $package == "inkscape" )
+  {
+    $max = find_max( $lines, "/Latest/", "/^.*Latest 
stable.*(\d[\d\.]+\d).*$/" );
+
+    // Upstrem's website info does not match tarball verion for non point 
versions
+    $dots = 0;
+
+    for ( $i = 0; $i < strlen($max); $i++ ) 
+    {
+      if ( $max[$i] == '.' ) $dots++;
+    }
+
+    if ( $dots < 2 ) $max .= '.0';
+
+    return $max;
+  }
 
   if ( preg_match( "/abiword/", "$dirpath" ) )
       return find_max( $lines, "/^\d/", "/^([\d\.]+).*$/" );
-- 
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