Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • lfs-latest-git.php

    r043e9bd r7b54528  
    1616$regex[ 'less'     ] = "/^.*current released version is less-(\d+).*$/";
    1717$regex[ 'mpfr'     ] = "/^mpfr-([\d\.]+)\.tar.*$/";
    18 //$regex[ 'Python'   ] = "/^.*Latest Python 3.*Python (3[\d\.]+\d).*$/";
     18$regex[ 'Python'   ] = "/^.*Latest Python 3.*Python (3[\d\.]+\d).*$/";
    1919//$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/";
    2020$regex[ 'tzdata'   ] = "/^.*tzdata([\d]+[a-z]).*$/";
     
    7878
    7979  if ( preg_match( "/sourceforge/", $url ) ||
    80        preg_match( "/python/",      $url ) ||
    8180       preg_match( "/psmisc/",      $url ) )
    8281  {
     
    136135if ( $package == "libffi"     ) $dirpath = github("libffi/libffi");
    137136if ( $package == "libxcrypt"  ) $dirpath = github("besser82/libxcrypt");
    138 if ( $package == "lz"         ) $dirpath = github("lz4/lz4");
    139137if ( $package == "meson"      ) $dirpath = github("mesonbuild/meson");
    140138if ( $package == "mpc"        ) $dirpath = "https://ftp.gnu.org/gnu/mpc";
     
    148146if ( $package == "sysvinit"   ) $dirpath = github("slicer69/sysvinit");
    149147if ( $package == "MarkupSafe" ) $dirpath = "https://pypi.python.org/pypi/MarkupSafe/";
    150 if ( $package == "jinja"      ) $dirpath = "https://pypi.python.org/pypi/Jinja2/";
     148if ( $package == "Jinja"      ) $dirpath = "https://pypi.python.org/pypi/Jinja2/";
    151149if ( $package == "systemd"    ) $dirpath = github("systemd/systemd");
    152150//if ( $package == "tcl"        ) $dirpath = "https://sourceforge.net/projects/tcl/files";
     
    163161  {
    164162    echo "ftp should not occur\n";
     163  /*
     164    $dirpath  = substr( $dirpath, 6 );           // Remove ftp://
     165    $dirpath  = rtrim ( $dirpath, "/" );         // Trim any trailing slash
     166    $position = strpos( $dirpath, "/" );         // Divide at first slash
     167    $server   = substr( $dirpath, 0, $position );
     168    $path     = substr( $dirpath, $position );
     169
     170    $conn = ftp_connect( $server );
     171    ftp_login( $conn, "anonymous", "" );
     172
     173    // See if we need special handling
     174    if ( isset( $exceptions[ $package ] ) )
     175    {
     176       $specials = explode( ":", $exceptions[ $package ] );
     177
     178       foreach ( $specials as $i )
     179       {
     180          list( $op, $regexp ) = explode( "=", $i );
     181
     182          switch ($op)
     183          {
     184            case "UPDIR":
     185              // Remove last dir from $path
     186              $position = strrpos( $path, "/" );
     187              $path = substr( $path, 0, $position );
     188
     189              // Get dir listing
     190              $lines = ftp_rawlist ($conn, $path);
     191              $max   = find_max( $lines, $regexp, $regexp );
     192              break;
     193
     194            case "DOWNDIR":
     195              // Append found directory
     196              $path .= "/$max";
     197              break;
     198
     199            default:
     200              echo "Error in specials array for $package\n";
     201              return -5;
     202              break;
     203          }
     204       }
     205    }
     206
     207    $lines = ftp_rawlist ($conn, $path);
     208    ftp_close( $conn );
     209*/
    165210  }
    166211  else // http(s)
     
    259304
    260305  if ( $package == "psmisc" )
    261      return find_max( $lines, "/v\d/", "/^.*v([\d\.]+)$/" );
     306     return find_max( $lines, "/v\d/", "/^.*v([\d\.]+).tar.*$/" );
    262307
    263308  if ( $package == "grub" )
    264309     return find_max( $lines, "/grub/", "/^.*grub-([\d\.]+).tar.xz.*$/" );
    265310
    266   if ( $package == "jinja" )
     311  if ( $package == "Jinja" )
    267312     return find_max( $lines, "/Jinja/", "/^.*Jinja2 ([\d\.]+).*$/" );
    268 
    269   if ( $package == "lz" )
    270      return find_max( $lines, "/name.:/", '/^.*LZ4 v([\d\.]+)".*$/' );
    271313
    272314  if ( $package == "openssl" )
    273315     return find_max( $lines, "/openssl/", "/^.*openssl-([\d\.p]*\d.?).tar.*$/" );
    274 
    275   if ( $package == "Python" )
    276      return find_max( $lines, "/Python 3/", "/^.*Python (3[\d\.]*\d) .*$/" );
    277316
    278317  if ( $package == "vim" )
     
    294333   // Fetech from git and get wget-list
    295334   $current = array();
     335   #$lfssvn = "svn://svn.linuxfromscratch.org/LFS/trunk";
    296336   $lfsgit = "https://git.linuxfromscratch.org/lfs.git";
    297337
     
    325365      $file        = rtrim( $file );
    326366      $pkg_pattern = "/(\D*).*/";
     367      //$pattern     = "/\D*(\d.*\d)\D*/";
    327368      $pattern     = "/\D*(\d.*\d)\D*/";
    328369
Note: See TracChangeset for help on using the changeset viewer.