Changeset 0739fa7 for lfs-latest-git.php


Ignore:
Timestamp:
04/14/2021 06:35:19 PM (8 months ago)
Author:
Bruce Dubbs <bdubbs@…>
Branches:
11.0, 11.0-rc1, 11.0-rc2, 11.0-rc3, ml-11.0, multilib, trunk, xry111/glibc-2.34, xry111/tester-nohack, xry111/usr-move
Children:
24c34df, c74edb3
Parents:
05cfebad
Message:

Update lfs-latest to work with git and send to new server mailing list.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lfs-latest-git.php

    r05cfebad r0739fa7  
    8181  else
    8282  {
    83     exec( "links -dump $url 2>/dev/null", $lines );
     83    exec( "lynx -dump $url 2>/dev/null", $lines );
    8484    return $lines;
    8585  }
     
    107107  global $regex;
    108108
    109 //if ( $package != "psmisc" ) return 0; // Debug
     109//if ( $package != "psmisc" ) return 0; // debug
    110110
    111111if ( $package == "bc"         ) $dirpath = "https://github.com/gavinhoward/bc/releases";
    112112if ( $package == "check"      ) $dirpath = "https://github.com/libcheck/check/releases";
    113 if ( $package == "e2fsprogs"  ) $dirpath = "http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs";
     113if ( $package == "e2fsprogs"  ) $dirpath = "https://sourceforge.net/projects/e2fsprogs/files/e2fsprogs/";
    114114if ( $package == "expat"      ) $dirpath = "http://sourceforge.net/projects/expat/files";
    115115if ( $package == "elfutils"   ) $dirpath = "https://sourceware.org/ftp/elfutils"; 
     
    184184    ftp_close( $conn );
    185185  }
    186   else // http
     186  else // http(s)
    187187  {
    188188     // Customize http directories as needed
     
    197197     }
    198198
    199      //if ( $package == "bzip2" )
    200      //{
    201      //   // Remove one directory
    202      //   $dirpath  = rtrim  ( $dirpath, "/" );    // Trim any trailing slash
    203      //   $position = strrpos( $dirpath, "/" );
    204      //   $dirpath  = substr ( $dirpath, 0, $position );
    205      //}
    206 
    207199     $lines = http_get_file( $dirpath );
    208200     if ( ! is_array( $lines ) ) return -6;
    209201  } // End fetch
    210 //print_r($lines);
     202
    211203  if ( isset( $regex[ $package ] ) )
    212204  {
     
    318310   #exec ( "svn --quiet export $lfssvn LFS" );
    319311   exec ( "git clone $lfsgit LFS" );
     312
     313   # Make version.ent
     314   chdir( "$tmpdir/LFS" );
     315   exec ( "./git-version.sh" );
     316
    320317   chdir( $cdir );
    321318
     
    384381   global $dirs;
    385382
    386    //$to      = "bruce.dubbs@gmail.com";
    387    //$to      = "lfs-book@lists.linuxfromscratch.org";
    388    $to      = "bdubbs";  // Just local for now
    389    $from    = "bdubbs@linuxfromscratch.org";
     383   $to      = "lfs-book@lists4.linuxfromscratch.org";
     384   $from    = "bdubbs@rivendell.linuxfromscratch.org";
    390385   $subject = "LFS Package Currency Check - $date GMT";
    391386   $headers = "From: bdubbs@rivendell.linuxfromscratch.org";
     
    479474}
    480475
     476function write_to_stdout()
     477{
     478
     479   global $date;
     480   global $vers;
     481   global $dirs;
     482
     483   echo "
     484LFS Package Currency Check
     485As of $date GMT
     486
     487LFS Package     LFS Version Latest Flag\n";
     488
     489   // Get the latest version of each package
     490   foreach ( $dirs as $pkg => $dir )
     491   {
     492      $p_name    = sprintf( "%-15s", $pkg );       // package name formatted
     493
     494      $b_version = $vers[ $pkg ];                 // book version
     495      $b_string  = sprintf( "%-11s", $b_version ); // book version formatted
     496
     497      $latest    = get_packages( $pkg, $dir );    // latest version
     498      $l_string  = sprintf( "%-6s", $latest );     // latest version formatted
     499
     500      $flag = ( $b_version != $latest ) ? "*" : "";
     501      echo "$p_name $b_string $l_string  $flag\n";
     502   }
     503}
     504
    481505get_current();  // Get what is in the book
    482506mail_to_lfs();
    483507//html();  // Write html output
     508//write_to_stdout();  // For debugging
    484509?>
Note: See TracChangeset for help on using the changeset viewer.