[5d4c24a] | 1 | #! /usr/bin/php
|
---|
| 2 | <?php
|
---|
| 3 | $dirs = array();
|
---|
| 4 | $vers = array();
|
---|
| 5 |
|
---|
| 6 | date_default_timezone_set( "GMT" );
|
---|
| 7 | $date = date( "Y-m-d H:i:s" );
|
---|
| 8 |
|
---|
| 9 | // Special cases
|
---|
| 10 | $exceptions = array();
|
---|
| 11 | //$exceptions[ 'gmp' ] = "UPDIR=/.*(gmp-\d[\d\.-]*\d).*/:DOWNDIR=";
|
---|
| 12 |
|
---|
| 13 | $regex = array();
|
---|
| 14 | $regex[ 'bzip2' ] = "/^.*current version is ([\d\.]+).*$/";
|
---|
| 15 | $regex[ 'check' ] = "/^.*Check (\d[\d\.]+\d).*$/";
|
---|
| 16 | $regex[ 'intltool' ] = "/^.*Latest version is (\d[\d\.]+\d).*$/";
|
---|
| 17 | $regex[ 'less' ] = "/^.*current released version is less-(\d+).*$/";
|
---|
| 18 | $regex[ 'mpfr' ] = "/^mpfr-([\d\.]+)\.tar.*$/";
|
---|
| 19 | $regex[ 'systemd' ] = "/^.*v([\d]+).*$/";
|
---|
[4457d72] | 20 | //$regex[ 'sysvinit' ] = "/^.*sysvinit-([\d\.]+)dsf\.tar.*$/";
|
---|
[5d4c24a] | 21 | $regex[ 'tzdata' ] = "/^.*tzdata([\d]+[a-z]).*$/";
|
---|
| 22 | $regex[ 'xz' ] = "/^.*xz-([\d\.]*\d).*$/";
|
---|
| 23 | $regex[ 'zlib' ] = "/^.*zlib ([\d\.]*\d).*$/";
|
---|
| 24 |
|
---|
| 25 | function find_max( $lines, $regex_match, $regex_replace )
|
---|
| 26 | {
|
---|
| 27 | $a = array();
|
---|
| 28 | if ( ! is_array( $lines ) ) return -1;
|
---|
| 29 |
|
---|
| 30 | foreach ( $lines as $line )
|
---|
| 31 | {
|
---|
| 32 | if ( ! preg_match( $regex_match, $line ) ) continue;
|
---|
| 33 |
|
---|
| 34 | // Isolate the version and put in an array
|
---|
| 35 | $slice = preg_replace( $regex_replace, "$1", $line );
|
---|
| 36 | if ( $slice == $line ) continue;
|
---|
| 37 |
|
---|
| 38 | array_push( $a, $slice );
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | // SORT_NATURAL requires php-5.4.0 or later
|
---|
| 42 | rsort( $a, SORT_NATURAL ); // Max version is at the top
|
---|
| 43 | return ( isset( $a[0] ) ) ? $a[0] : -2;
|
---|
| 44 | }
|
---|
| 45 |
|
---|
| 46 | function find_even_max( $lines, $regex_match, $regex_replace )
|
---|
| 47 | {
|
---|
| 48 | $a = array();
|
---|
| 49 | foreach ( $lines as $line )
|
---|
| 50 | {
|
---|
| 51 | if ( ! preg_match( $regex_match, $line ) ) continue;
|
---|
| 52 |
|
---|
| 53 | // Isolate the version and put in an array
|
---|
| 54 | $slice = preg_replace( $regex_replace, "$1", $line );
|
---|
| 55 |
|
---|
| 56 | if ( "x$slice" == "x$line" ) continue;
|
---|
| 57 |
|
---|
| 58 | // Skip odd numbered minor versions and minors > 80
|
---|
| 59 | list( $major, $minor, $rest ) = explode( ".", $slice . ".0" );
|
---|
| 60 | if ( $minor % 2 == 1 ) continue;
|
---|
| 61 | if ( $minor > 80 ) continue;
|
---|
| 62 | array_push( $a, $slice );
|
---|
| 63 | }
|
---|
| 64 |
|
---|
| 65 | rsort( $a, SORT_NATURAL ); // Max version is at the top
|
---|
| 66 | return ( isset( $a[0] ) ) ? $a[0] : -2;
|
---|
| 67 | }
|
---|
| 68 |
|
---|
| 69 | function http_get_file( $url )
|
---|
| 70 | {
|
---|
| 71 | if ( ! preg_match( "/sourceforge/", $url ) )
|
---|
| 72 | {
|
---|
| 73 | exec( "curl --location --silent --max-time 30 $url", $dir );
|
---|
| 74 |
|
---|
| 75 | $s = implode( "\n", $dir );
|
---|
| 76 | $dir = strip_tags( $s );
|
---|
| 77 | return explode( "\n", $dir );
|
---|
| 78 | }
|
---|
| 79 | else
|
---|
| 80 | {
|
---|
[60d91a0] | 81 | exec( "links -dump $url 2>/dev/null", $lines );
|
---|
[5d4c24a] | 82 | return $lines;
|
---|
| 83 | }
|
---|
| 84 | }
|
---|
| 85 |
|
---|
| 86 | function max_parent( $dirpath, $prefix )
|
---|
| 87 | {
|
---|
| 88 | // First, remove a directory
|
---|
| 89 | $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
|
---|
| 90 | $position = strrpos( $dirpath, "/" );
|
---|
| 91 | $dirpath = substr ( $dirpath, 0, $position );
|
---|
| 92 |
|
---|
| 93 | $lines = http_get_file( $dirpath );
|
---|
| 94 |
|
---|
| 95 | $regex_match = "#${prefix}[\d\.]+/#";
|
---|
| 96 | $regex_replace = "#^.*(${prefix}[\d\.]+)/.*$#";
|
---|
| 97 | $max = find_max( $lines, $regex_match, $regex_replace );
|
---|
| 98 |
|
---|
| 99 | return "$dirpath/$max";
|
---|
| 100 | }
|
---|
| 101 |
|
---|
| 102 | function get_packages( $package, $dirpath )
|
---|
| 103 | {
|
---|
| 104 | global $exceptions;
|
---|
| 105 | global $regex;
|
---|
| 106 |
|
---|
[c0904fc] | 107 | //if ( $package != "expat" ) return 0; // Debug
|
---|
[5d4c24a] | 108 |
|
---|
| 109 | if ( $package == "check" ) $dirpath = "https://github.com/libcheck/check/releases";
|
---|
| 110 | if ( $package == "e2fsprogs" ) $dirpath = "http://sourceforge.net/projects/e2fsprogs/files/e2fsprogs";
|
---|
| 111 | if ( $package == "expat" ) $dirpath = "http://sourceforge.net/projects/expat/files";
|
---|
[c0904fc] | 112 | if ( $package == "expect" ) $dirpath = "http://sourceforge.net/projects/expect/files";
|
---|
[5d4c24a] | 113 | if ( $package == "file" ) $dirpath = "https://github.com/file/file/releases";
|
---|
| 114 | if ( $package == "flex" ) $dirpath = "https://github.com/westes/flex/releases";
|
---|
| 115 | if ( $package == "gcc" ) $dirpath = max_parent( $dirpath, "gcc-" );
|
---|
| 116 | if ( $package == "intltool" ) $dirpath = "https://launchpad.net/intltool/trunk";
|
---|
[7886729e] | 117 | if ( $package == "meson" ) $dirpath = "https://github.com/mesonbuild/meson/releases";
|
---|
[9901037e] | 118 | if ( $package == "mpc" ) $dirpath = "https://ftp.gnu.org/gnu/mpc";
|
---|
[5d4c24a] | 119 | if ( $package == "mpfr" ) $dirpath = "http://mpfr.loria.fr/mpfr-current";
|
---|
[7886729e] | 120 | if ( $package == "ninja" ) $dirpath = "https://github.com/ninja-build/ninja/releases";
|
---|
[5d4c24a] | 121 | if ( $package == "procps-ng" ) $dirpath = "http://sourceforge.net/projects/procps-ng/files";
|
---|
| 122 | if ( $package == "psmisc" ) $dirpath = "http://sourceforge.net/projects/$package/files";
|
---|
| 123 | if ( $package == "shadow" ) $dirpath = "https://github.com/shadow-maint/shadow/releases";
|
---|
| 124 | if ( $package == "systemd" ) $dirpath = "https://github.com/systemd/systemd/releases";
|
---|
[c0904fc] | 125 | if ( $package == "tcl" ) $dirpath = "http://sourceforge.net/projects/tcl/files";
|
---|
[5d4c24a] | 126 | if ( $package == "util-linux" ) $dirpath = max_parent( $dirpath, "v." );
|
---|
| 127 | if ( $package == "vim" ) $dirpath = "ftp://ftp.vim.org/pub/vim/unix";
|
---|
| 128 |
|
---|
| 129 | // Check for ftp
|
---|
| 130 | if ( preg_match( "/^ftp/", $dirpath ) )
|
---|
| 131 | {
|
---|
| 132 | $dirpath = substr( $dirpath, 6 ); // Remove ftp://
|
---|
| 133 | $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
|
---|
| 134 | $position = strpos( $dirpath, "/" ); // Divide at first slash
|
---|
| 135 | $server = substr( $dirpath, 0, $position );
|
---|
| 136 | $path = substr( $dirpath, $position );
|
---|
| 137 |
|
---|
| 138 | $conn = ftp_connect( $server );
|
---|
| 139 | ftp_login( $conn, "anonymous", "" );
|
---|
| 140 |
|
---|
| 141 | // See if we need special handling
|
---|
| 142 | if ( isset( $exceptions[ $package ] ) )
|
---|
| 143 | {
|
---|
| 144 | $specials = explode( ":", $exceptions[ $package ] );
|
---|
| 145 |
|
---|
| 146 | foreach ( $specials as $i )
|
---|
| 147 | {
|
---|
| 148 | list( $op, $regexp ) = explode( "=", $i );
|
---|
| 149 |
|
---|
| 150 | switch ($op)
|
---|
| 151 | {
|
---|
| 152 | case "UPDIR":
|
---|
| 153 | // Remove last dir from $path
|
---|
| 154 | $position = strrpos( $path, "/" );
|
---|
| 155 | $path = substr( $path, 0, $position );
|
---|
| 156 |
|
---|
| 157 | // Get dir listing
|
---|
| 158 | $lines = ftp_rawlist ($conn, $path);
|
---|
| 159 | $max = find_max( $lines, $regexp, $regexp );
|
---|
| 160 | break;
|
---|
| 161 |
|
---|
| 162 | case "DOWNDIR":
|
---|
| 163 | // Append found directory
|
---|
| 164 | $path .= "/$max";
|
---|
| 165 | break;
|
---|
| 166 |
|
---|
| 167 | default:
|
---|
| 168 | echo "Error in specials array for $package\n";
|
---|
| 169 | return -5;
|
---|
| 170 | break;
|
---|
| 171 | }
|
---|
| 172 | }
|
---|
| 173 | }
|
---|
| 174 |
|
---|
| 175 | $lines = ftp_rawlist ($conn, $path);
|
---|
| 176 | ftp_close( $conn );
|
---|
| 177 | }
|
---|
| 178 | else // http
|
---|
| 179 | {
|
---|
| 180 | // Customize http directories as needed
|
---|
| 181 | if ( $package == "tzdata" )
|
---|
| 182 | {
|
---|
| 183 | // Remove two directories
|
---|
| 184 | $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
|
---|
| 185 | $position = strrpos( $dirpath, "/" );
|
---|
| 186 | $dirpath = substr ( $dirpath, 0, $position );
|
---|
| 187 | $position = strrpos( $dirpath, "/" );
|
---|
| 188 | $dirpath = substr ( $dirpath, 0, $position );
|
---|
| 189 | }
|
---|
| 190 |
|
---|
| 191 | if ( $package == "bzip2" )
|
---|
| 192 | {
|
---|
| 193 | // Remove one directory
|
---|
| 194 | $dirpath = rtrim ( $dirpath, "/" ); // Trim any trailing slash
|
---|
| 195 | $position = strrpos( $dirpath, "/" );
|
---|
| 196 | $dirpath = substr ( $dirpath, 0, $position );
|
---|
| 197 | }
|
---|
| 198 |
|
---|
| 199 | $lines = http_get_file( $dirpath );
|
---|
| 200 | if ( ! is_array( $lines ) ) return -6;
|
---|
| 201 | } // End fetch
|
---|
[c0904fc] | 202 | //print_r($lines);
|
---|
[5d4c24a] | 203 | if ( isset( $regex[ $package ] ) )
|
---|
| 204 | {
|
---|
| 205 | // Custom search for latest package name
|
---|
| 206 | foreach ( $lines as $l )
|
---|
| 207 | {
|
---|
| 208 | $ver = preg_replace( $regex[ $package ], "$1", $l );
|
---|
| 209 | if ( $ver == $l ) continue;
|
---|
| 210 | return $ver; // Return first match of regex
|
---|
| 211 | }
|
---|
| 212 |
|
---|
| 213 | return -7; // This is an error
|
---|
| 214 | }
|
---|
| 215 |
|
---|
| 216 | if ( $package == "perl" ) // Custom for perl
|
---|
| 217 | {
|
---|
| 218 | $tmp = array();
|
---|
| 219 |
|
---|
| 220 | foreach ( $lines as $l )
|
---|
| 221 | {
|
---|
| 222 | if ( preg_match( "/sperl/", $l ) ) continue; // Don't want this
|
---|
| 223 | $ver = preg_replace( "/^.*perl-([\d\.]+\d)\.tar.*$/", "$1", $l );
|
---|
| 224 | if ( $ver == $l ) continue;
|
---|
| 225 | list( $s1, $s2, $rest ) = explode( ".", $ver );
|
---|
| 226 | if ( $s2 % 2 == 1 ) continue; // Remove odd minor versions
|
---|
| 227 | array_push( $tmp, $l );
|
---|
| 228 | }
|
---|
| 229 |
|
---|
| 230 | $lines = $tmp;
|
---|
| 231 | }
|
---|
| 232 |
|
---|
| 233 | if ( $package == "attr" ||
|
---|
| 234 | $package == "acl" )
|
---|
| 235 | {
|
---|
| 236 | return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.src.*$/" );
|
---|
| 237 | }
|
---|
| 238 |
|
---|
| 239 | if ( $package == "e2fsprogs" )
|
---|
| 240 | return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]+\d).*$/" );
|
---|
| 241 |
|
---|
[c0904fc] | 242 | if ( $package == "expect" )
|
---|
| 243 | return find_max( $lines, "/expect/", "/^.*expect(\d[\d\.]+\d).tar.*$/" );
|
---|
| 244 |
|
---|
[5d4c24a] | 245 | if ( $package == "XML-Parser" )
|
---|
| 246 | {
|
---|
| 247 | $max = find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d).tar.*$/" );
|
---|
| 248 | # 2.44_01 is a developer release
|
---|
| 249 | if ( $max == "2.44_01" ) { return "2.44"; }
|
---|
| 250 | return $max;
|
---|
| 251 | }
|
---|
| 252 |
|
---|
[c0904fc] | 253 | if ( $package == "tcl" )
|
---|
| 254 | return find_max( $lines, "/tcl/", "/^.*tcl(\d[\d\.]*\d)-src.*$/" );
|
---|
| 255 |
|
---|
[7886729e] | 256 | if ( $package == "ninja" )
|
---|
| 257 | return find_max( $lines, "/v\d/", "/^.*v(\d[\d\.]*\d).*$/" );
|
---|
| 258 |
|
---|
[5d4c24a] | 259 | if ( $package == "gmp" )
|
---|
| 260 | return find_max( $lines, "/$package/", "/^.*$package-([\d\._]*\d[a-z]?).tar.*$/" );
|
---|
| 261 |
|
---|
| 262 | if ( $package == "dbus" )
|
---|
| 263 | return find_even_max( $lines, "/$package/", "/^.*$package-([\d\.]+).tar.*$/" );
|
---|
| 264 |
|
---|
| 265 | if ( $package == "file" )
|
---|
| 266 | {
|
---|
| 267 | $max = find_max( $lines, "/FILE5/", "/^.*FILE(5_\d+)*$/" );
|
---|
| 268 | return str_replace( "_", ".", $max );
|
---|
| 269 | }
|
---|
| 270 |
|
---|
| 271 | if ( $package == "grub" )
|
---|
| 272 | return find_max( $lines, "/grub/", "/^.*grub-(\d\..*).tar.xz.*$/" );
|
---|
| 273 |
|
---|
[c0904fc] | 274 | if ( $package == "openssl" )
|
---|
| 275 | return find_max( $lines, "/openssl/", "/^.*openssl-([\d\.p]*\d.?).tar.*$/" );
|
---|
| 276 |
|
---|
[5d4c24a] | 277 | // Most packages are in the form $package-n.n.n
|
---|
| 278 | // Occasionally there are dashes (e.g. 201-1)
|
---|
| 279 | return find_max( $lines, "/$package/", "/^.*$package-([\d\.-]*\d)\.tar.*$/" );
|
---|
| 280 | }
|
---|
| 281 |
|
---|
| 282 | function get_current()
|
---|
| 283 | {
|
---|
| 284 | global $dirs;
|
---|
| 285 | global $vers;
|
---|
| 286 |
|
---|
| 287 | // Fetech from svn and get wget-list
|
---|
| 288 | $current = array();
|
---|
| 289 | $lfssvn = "svn://svn.linuxfromscratch.org/LFS/trunk";
|
---|
| 290 |
|
---|
| 291 | $tmpdir = exec( "mktemp -d /tmp/lfscheck.XXXXXX" );
|
---|
| 292 | $cdir = getcwd();
|
---|
| 293 | chdir( $tmpdir );
|
---|
| 294 | exec ( "svn --quiet export $lfssvn LFS" );
|
---|
| 295 | chdir( $cdir );
|
---|
| 296 |
|
---|
| 297 | $PAGE = "$tmpdir/LFS/BOOK/chapter03/chapter03.xml";
|
---|
| 298 | $STYLESHEET = "$tmpdir/LFS/BOOK/stylesheets/wget-list.xsl";
|
---|
| 299 |
|
---|
| 300 | exec( "xsltproc --xinclude --nonet $STYLESHEET $PAGE", $current );
|
---|
| 301 | exec( "rm -rf $tmpdir" );
|
---|
| 302 |
|
---|
| 303 | foreach ( $current as $line )
|
---|
| 304 | {
|
---|
| 305 | $file = basename( $line ) . "\n";
|
---|
| 306 | if ( preg_match( "/patch$/", $file ) ) { continue; } // Skip patches
|
---|
| 307 |
|
---|
| 308 | $file = preg_replace( "/bz2/", '', $file ); // The 2 confusses the regex
|
---|
| 309 |
|
---|
| 310 | $file = rtrim( $file );
|
---|
| 311 | $pkg_pattern = "/(\D*).*/";
|
---|
| 312 | //$pattern = "/\D*(\d.*\d)\D*/";
|
---|
| 313 | $pattern = "/\D*(\d.*\d)\D*/";
|
---|
| 314 |
|
---|
| 315 | if ( preg_match( "/e2fsprogs/", $file ) )
|
---|
| 316 | {
|
---|
| 317 | $pattern = "/e2\D*(\d.*\d)\D*/";
|
---|
| 318 | $pkg_pattern = "/(e2\D*).*/";
|
---|
| 319 | }
|
---|
| 320 |
|
---|
| 321 | else if ( preg_match( "/tzdata/", $file ) )
|
---|
| 322 | {
|
---|
| 323 | $pattern = "/\D*(\d.*[a-z])\.tar\D*/";
|
---|
| 324 | }
|
---|
| 325 |
|
---|
[c0904fc] | 326 | else if ( preg_match( "/openssl/", $file ) )
|
---|
| 327 | {
|
---|
| 328 | $pattern = "/\D*(\d.*\d.*).tar.*$/";
|
---|
| 329 | }
|
---|
| 330 |
|
---|
[5d4c24a] | 331 | else if ( preg_match( "/gmp/", $file ) )
|
---|
| 332 | {
|
---|
| 333 | $pattern = "/\D*(\d.*[a-z]*)\.tar\D*/";
|
---|
| 334 | }
|
---|
| 335 |
|
---|
[c0904fc] | 336 | else if ( preg_match( "/systemd-man-pages/", $file ) ) continue;
|
---|
| 337 | else if ( preg_match( "/python/" , $file ) ) continue;
|
---|
[5d4c24a] | 338 |
|
---|
| 339 | $version = preg_replace( $pattern, "$1", $file ); // Isolate version
|
---|
| 340 | $version = preg_replace( "/^\d-/", "", $version ); // Remove leading #-
|
---|
| 341 |
|
---|
| 342 | // Touch up package names
|
---|
| 343 | $pkg_name = preg_replace( $pkg_pattern, "$1", $file );
|
---|
| 344 | $pkg_name = trim( $pkg_name, "-" );
|
---|
| 345 |
|
---|
| 346 | if ( preg_match( "/bzip|iproute/", $pkg_name ) ) { $pkg_name .= "2"; }
|
---|
| 347 | if ( preg_match( "/^m$/" , $pkg_name ) ) { $pkg_name .= "4"; }
|
---|
| 348 | if ( preg_match( "/shadow/" , $pkg_name ) ) { $pkg_name = "shadow"; }
|
---|
| 349 |
|
---|
| 350 | $dirs[ $pkg_name ] = dirname( $line );
|
---|
| 351 | $vers[ $pkg_name ] = $version;
|
---|
| 352 | }
|
---|
| 353 | }
|
---|
| 354 |
|
---|
| 355 | function mail_to_lfs()
|
---|
| 356 | {
|
---|
| 357 | global $date;
|
---|
| 358 | global $vers;
|
---|
| 359 | global $dirs;
|
---|
| 360 |
|
---|
| 361 | //$to = "bruce.dubbs@gmail.com";
|
---|
| 362 | $to = "lfs-book@lists.linuxfromscratch.org";
|
---|
| 363 | $from = "bdubbs@linuxfromscratch.org";
|
---|
| 364 | $subject = "LFS Package Currency Check - $date GMT";
|
---|
| 365 | $headers = "From: bdubbs@anduin.linuxfromscratch.org";
|
---|
| 366 |
|
---|
| 367 | $message = "Package LFS Upstream Flag\n\n";
|
---|
| 368 |
|
---|
| 369 | foreach ( $dirs as $pkg => $dir )
|
---|
| 370 | {
|
---|
| 371 | //if ( $pkg != "gmp" ) continue; //debug
|
---|
| 372 | $v = get_packages( $pkg, $dir );
|
---|
| 373 |
|
---|
| 374 | $flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
|
---|
| 375 |
|
---|
| 376 | // Pad for output
|
---|
| 377 | $pad = " ";
|
---|
| 378 | $p = substr( $pkg . $pad, 0, 15 );
|
---|
| 379 | $l = substr( $vers[ $pkg ] . $pad, 0, 10 );
|
---|
| 380 | $c = substr( $v . $pad, 0, 10 );
|
---|
| 381 |
|
---|
| 382 | $message .= "$p $l $c $flag\n";
|
---|
| 383 | }
|
---|
| 384 |
|
---|
| 385 | exec ( "echo '$message' | mailx -r $from -s '$subject' $to" );
|
---|
| 386 | //echo $message;
|
---|
| 387 | }
|
---|
| 388 |
|
---|
| 389 | function html()
|
---|
| 390 | {
|
---|
| 391 |
|
---|
| 392 | global $date;
|
---|
| 393 | global $vers;
|
---|
| 394 | global $dirs;
|
---|
| 395 |
|
---|
| 396 | echo "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
---|
| 397 | 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
---|
| 398 | <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
---|
| 399 | <head>
|
---|
| 400 | <title>LFS Package Currency Check - $date</title>
|
---|
| 401 | <style type='text/css'>
|
---|
| 402 | h1, h2 {
|
---|
| 403 | text-align : center;
|
---|
| 404 | }
|
---|
| 405 |
|
---|
| 406 | table {
|
---|
| 407 | border-width : 1px;
|
---|
| 408 | border-spacing : 0px;
|
---|
| 409 | border-style : outset;
|
---|
| 410 | border-color : gray;
|
---|
| 411 | border-collapse : separate;
|
---|
| 412 | background-color: white;
|
---|
| 413 | margin : 0px auto;
|
---|
| 414 | }
|
---|
| 415 |
|
---|
| 416 | table th {
|
---|
| 417 | border-width : 1px;
|
---|
| 418 | padding : 2px;
|
---|
| 419 | border-style : inset;
|
---|
| 420 | border-color : gray;
|
---|
| 421 | background-color: white;
|
---|
| 422 | }
|
---|
| 423 |
|
---|
| 424 | table td {
|
---|
| 425 | border-width : 1px;
|
---|
| 426 | padding : 2px;
|
---|
| 427 | border-style : inset;
|
---|
| 428 | border-color : gray;
|
---|
| 429 | background-color: white;
|
---|
| 430 | }
|
---|
| 431 | </style>
|
---|
| 432 |
|
---|
| 433 | </head>
|
---|
| 434 | <body>
|
---|
| 435 | <h1>LFS Package Currency Check</h1>
|
---|
| 436 | <h2>As of $date GMT</h1>
|
---|
| 437 |
|
---|
| 438 | <table>
|
---|
| 439 | <tr><th>LFS Package</th> <th>LFS Version</th> <th>Latest</th> <th>Flag</th></tr>\n";
|
---|
| 440 |
|
---|
| 441 | // Get the latest version of each package
|
---|
| 442 | foreach ( $dirs as $pkg => $dir )
|
---|
| 443 | {
|
---|
| 444 | $v = get_packages( $pkg, $dir );
|
---|
| 445 | $flag = ( $vers[ $pkg ] != $v ) ? "*" : "";
|
---|
| 446 | echo "<tr><td>$pkg</td> <td>${vers[ $pkg ]}</td> <td>$v</td> <td>$flag</td></tr>\n";
|
---|
| 447 | }
|
---|
| 448 |
|
---|
| 449 | echo "</table>
|
---|
| 450 | </body>
|
---|
| 451 | </html>\n";
|
---|
| 452 |
|
---|
| 453 | }
|
---|
| 454 |
|
---|
| 455 | get_current(); // Get what is in the book
|
---|
| 456 | mail_to_lfs();
|
---|
| 457 | //html(); // Write html output
|
---|
| 458 | ?>
|
---|