William Harrington wrote: > > On May 14, 2013, at 11:27 PM, Bruce Dubbs wrote: > >> I fixed that a couple of days ago. >> >> -- Bruce >> > Is the script at > http://anduin.linuxfromscratch.org/~bdubbs/lfs-latest-files reflecting > your changes or do you copy the script after changes?
Not quite. I just put that out as an example of fetching via svn/ftp/http and some examples of using regex expressions. The changes are not great, but the edited diff below shows the relevant changes. Mostly regex additions/changes. -- Bruce --- public_html/lfs-latest-files.phps 2013-05-10 14:27:18.000000000 +0000 +++ latest.php 2013-05-15 02:55:03.000000000 +0000 @@ -11,14 +11,16 @@ $exceptions[ 'gmp' ] = "UPDIR=/.*(gmp-\d[\d\.-]*\d).*/:DOWNDIR="; $regex = array(); -$regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/"; -$regex[ 'expect' ] = "/^.*Download expect([\d\.]+)\.tar.*$/"; -$regex[ 'mpc' ] = "/^Version ([\d\.]+).*$/"; -$regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/"; -$regex[ 'tcl' ] = "/^.*Download tcl([\d\.]+)-src.*$/"; -$regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/"; -$regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/"; -$regex[ 'zlib' ] = "/^.*zlib ([\d\.]*\d).*$/"; +$regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/"; +$regex[ 'expect' ] = "/^.*Download expect([\d\.]+)\.tar.*$/"; +$regex[ 'less' ] = "/^.*current released version is less-(\d+).*$/"; +$regex[ 'mpc' ] = "/^Version ([\d\.]+).*$/"; +$regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/"; +$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/"; +$regex[ 'tcl' ] = "/^.*Download tcl([\d\.]+)-src.*$/"; +$regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/"; +$regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/"; +$regex[ 'zlib' ] = "/^.*zlib ([\d\.]*\d).*$/"; function find_max( $lines, $regex_match, $regex_replace ) { @@ -202,7 +207,7 @@ foreach ( $lines as $l ) { if ( preg_match( "/sperl/", $l ) ) continue; // Don't want this - $ver = preg_replace( "/^.*$package-([\d\.-]*\d).*$/", "$1", $l ); + $ver = preg_replace( "/^.*perl-([\d\.]+\d)\.tar.*$/", "$1", $l ); if ( $ver == $l ) continue; list( $s1, $s2, $rest ) = explode( ".", $ver ); if ( $s2 % 2 == 1 ) continue; // Remove odd minor versions @@ -214,7 +219,7 @@ // Most packages are in the form $package-n.n.n // Occasionally there are dashes (e.g. 201-1) - $max = find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d).*$/" ); + $max = find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" ); return $max; } @@ -282,10 +288,13 @@ global $vers; global $dirs; $to = "lfs-b...@linuxfromscratch.org"; + $from = "bdu...@linuxfromscratch.org"; $subject = "LFS Package Currency Check - $date GMT"; + $headers = "From: bdu...@anduin.linuxfromscratch.org"; - $message = "Package LFS Upstream Flag\n\n"; + $message = "Package LFS Upstream Flag\n\n"; foreach ( $dirs as $pkg => $dir ) { @@ -297,13 +306,14 @@ // Pad for output $pad = " "; $p = substr( $pkg . $pad, 0, 15 ); - $l = substr( $vers[ $pkg ] . $pad, 0, 7 ); + $l = substr( $vers[ $pkg ] . $pad, 0, 8 ); $c = substr( $v . $pad, 0, 10 ); $message .= "$p $l $c $flag\n"; } -- http://linuxfromscratch.org/mailman/listinfo/lfs-dev FAQ: http://www.linuxfromscratch.org/faq/ Unsubscribe: See the above information page