Update to firefox-78.10.0 in svn
[beyond_linux_from_scratch.git] / scripts / summ-blfs.php
blobca1ff9d8127e8fa63414f2b6a90e34ea82b70e68
1 #! /usr/bin/php
2 <?php
4 date_default_timezone_set( "GMT" );
5 $date = date( "Y-m-d H:i:s" );
8 # Get ticket info
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 );
19 $l = 0;
21 $ticket = array();
22 $desc = array();
24 foreach ( $a as $line )
27 if ( preg_match( "/#/", $line ) )
29 $t = preg_replace( "/^.*(#\d+).*$/", "$1", $line );
30 $summary = $a[$l+3];
32 array_push( $ticket, $t );
33 array_push( $desc, trim($summary) );
36 $l++;
39 # Get package info
41 // HTML_DIR environment variable -- where to put html output
42 $d = getenv( 'HTML_DIR' );
43 $HTML_DIR = ($d) ? $d : '.';
45 exec( "grep '\*' $HTML_DIR/chapter*.html", $diff );
46 $d = implode( "\n", $diff );
48 $file = preg_replace( "/<\/td><td>/" , " " , $d );
49 $file = preg_replace( "/chapter(\d)\./", "chapter0$1.", $file );
50 $file = preg_replace( "/\*/" , " *" , $file );
51 $file = preg_replace( "/\.html/" , "" , $file );
52 $file = preg_replace( "/:/" , " " , $file );
53 $file = preg_replace( "/\/home.*chapter/" , "" , $file );
55 $f = strip_tags( $file );
56 $a = explode( "\n", $f );
57 sort($a);
59 $msg = " BLFS Package BLFS Version Latest Ticket\n";
61 foreach ( $a as $l )
63 $c = preg_split( "/ /", $l );
64 if ( $c[0] == "" ) continue;
65 $pkg = $c[1];
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" ||
74 $pkg == "konsole" ||
75 $pkg == "kate" ||
76 $pkg == "gwenview" ||
77 $pkg == "oxygen-icons" ||
78 $pkg == "kde-base-artwork" ||
79 $pkg == "kde-baseapps" ||
80 $pkg == "kdepimlibs" ||
81 $pkg == "obconf-qt" ||
82 $pkg == "libdbusmenu-qt" ||
83 $pkg == "juffed" ||
84 $pkg == "x264" ||
85 $pkg == "polkit"
86 ) continue;
88 //$pkg == "firefox" ||
90 if ( $c[3] == "0" ) $c[3] .= " ";
91 $x = substr("chapter $c[0]: $c[1] ", 0, 32);
92 $x .= substr("$c[2] ", 0, 25);
93 $x .= substr("$c[3] ", 0, 13);
95 $tick = "";
97 for ( $i=0; $i<count($ticket); $i++ )
99 $pkg = preg_replace( "/\+/", ".", $pkg );
100 // Matching as follows:
101 // "$pkg-Version", "$pkg " (whitespace), "$pkg," (comma), "$pkg" (only at end of the line)
102 if ( preg_match( "/$pkg(-[0-9]|,|\s|$)/i", $desc[$i] ) )
104 // Make sure cmake != cmake-extra-modules
105 if ( $pkg == "cmake" &&
106 preg_match( "/extra/", $desc[$i] )
107 ) continue;
109 $tick = $ticket[$i];
110 break;
114 $x .= "$tick\n";
115 //echo $x;
116 $msg .= $x;
119 //echo $msg; // For debugging
120 //exit;
122 $from = "bdubbs@linuxfromscratch.org";
123 $subject = "BLFS Package Currency Check - $date GMT";
124 $to = "blfs-book@lists.linuxfromscratch.org";
126 exec ( "echo '$msg' | mailx -r $from -s '$subject' $to" );