4 date_default_timezone_set( "GMT" );
5 $date = date( "Y-m-d H:i:s" );
9 $report = "http://wiki.linuxfromscratch.org/blfs/report/1";
10 $file = "/tmp/report.html";
12 system( "wget $report -q -O $file" );
14 $contents = file_get_contents( $file );
15 $c = strip_tags( $contents );
17 $a = explode( "\n", $c ); // Lines from trac report w/o html
24 foreach ( $a as $line )
26 if ( preg_match( "/#/", $line ) )
28 $t = preg_replace( "/^.*(#\d+).*$/", "$1", $line );
31 array_push( $ticket, $t );
32 array_push( $desc, trim($summary) );
40 // HTML_DIR environment variable -- where to put html output
41 $d = getenv( 'HTML_DIR' );
42 $HTML_DIR = ($d) ?
$d : '.';
44 exec( "grep '\*' $HTML_DIR/chapter*.html", $diff );
45 $d = implode( "\n", $diff );
47 $file = preg_replace( "/<\/td><td>/" , " " , $d );
48 $file = preg_replace( "/chapter(\d)\./", "chapter0$1.", $file );
49 $file = preg_replace( "/\*/" , " *" , $file );
50 $file = preg_replace( "/\.html/" , "" , $file );
51 $file = preg_replace( "/:/" , " " , $file );
52 $file = preg_replace( "/\/home.*chapter/" , "" , $file );
54 $f = strip_tags( $file );
55 $a = explode( "\n", $f ); // Now $a is lines from currency script output
58 $msg = " BLFS Package BLFS Version Latest Ticket\n";
62 $c = preg_split( "/ /", $l ); // $c is array from a line of currency script
63 if ( $c[0] == "" ) continue;
66 // Things to skio completely
67 if ( preg_match( "/libreoffice-/", $pkg ) ) continue;
69 if ( $pkg == "baloo" ||
70 $pkg == "baloo-widgets" ||
71 $pkg == "kactivities" ||
72 $pkg == "kfilemetadata" ||
73 $pkg == "kdeplasma-addons" ||
77 $pkg == "oxygen-icons" ||
78 $pkg == "kde-base-artwork" ||
79 $pkg == "kde-baseapps" ||
80 $pkg == "kdepimlibs" ||
81 $pkg == "obconf-qt" ||
82 $pkg == "libdbusmenu-qt" ||
88 // c[2] is book version
89 // c[3] is current version
91 if ( $c[3] == "0" ) $c[3] .= " ";
92 $x = substr("chapter $c[0]: $c[1] ", 0, 32);
93 $x .= substr("$c[2] ", 0, 25);
94 $x .= substr("$c[3] ", 0, 13);
98 for ( $i=0; $i<count($ticket); $i++
)
100 $pkg = preg_replace( "/\+/", ".", $pkg );
101 if ( preg_match( "/$pkg/i", $desc[$i] ) )
103 // Make sure cmake != cmake-extra-modules
104 if ( $pkg == "cmake" &&
105 preg_match( "/extra/", $desc[$i] )
118 echo $msg; // For debugging
121 $from = "bdubbs@linuxfromscratch.org";
122 $subject = "BLFS Package Currency Check - $date GMT";
123 $to = "blfs-book@lists.linuxfromscratch.org";
125 exec ( "echo '$msg' | mailx -r $from -s '$subject' $to" );