PLD-doc: PLD_www_res/buildlogs.sql/addlog.php, PLD_www_res/buildlo...

witekfl witekfl at pld-linux.org
Wed Nov 28 13:42:57 CET 2007


Author: witekfl                      Date: Wed Nov 28 12:42:57 2007 GMT
Module: PLD-doc                       Tag: HEAD
---- Log message:
- added more variables to the buildlogs.inc
- added th/amd64

---- Files affected:
PLD-doc/PLD_www_res/buildlogs.sql:
   addlog.php (1.5 -> 1.6) , index.php (1.6 -> 1.7) , migration.php (1.3 -> 1.4) , PRZECZYTAJ.TO (1.2 -> 1.3) , buildlogs.inc (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: PLD-doc/PLD_www_res/buildlogs.sql/addlog.php
diff -u PLD-doc/PLD_www_res/buildlogs.sql/addlog.php:1.5 PLD-doc/PLD_www_res/buildlogs.sql/addlog.php:1.6
--- PLD-doc/PLD_www_res/buildlogs.sql/addlog.php:1.5	Sun Nov 25 13:36:27 2007
+++ PLD-doc/PLD_www_res/buildlogs.sql/addlog.php	Wed Nov 28 13:42:52 2007
@@ -1,14 +1,13 @@
 #!/usr/bin/php.cli
 <?php
 // $Revision$, $Date$
+/*
 $database = 'sqlite:/home/services/ftp/buildlogs.db';
 $root_directory = '/home/services/ftp/pub/pld-buildlogs';
 // $database and $root_directory are taken from buildlogs.inc .
-include_once('buildlogs.inc');
 // parameter: argv[1] - full path to the log file.
 // Keep in sync with database
-$result = array("FAIL" => 0, "OK" => 1);
-$arch = array(
+$reverse_addr = array(
 	"th/SRPMS" => 1,
 	"th/i486" => 2,
 	"th/i686" => 3,
@@ -29,6 +28,10 @@
 	"ac/sparc" => 18,
 	"ac/sparc64" => 19
 );
+*/
+
+$result = array("FAIL" => 0, "OK" => 1);
+include('buildlogs.inc');
 
 if (!isset($argv[1])) {
 	die("Usage: $argv[0] full_path_to_the_log\n");
@@ -36,10 +39,10 @@
 preg_match("|$root_directory/(.*/.*)/(.*)/(.*)\.bz2|", $argv[1], $matches);
 
 $arch_name = $matches[1];
-if (!array_key_exists($arch_name, $arch)) {
+if (!array_key_exists($arch_name, $reverse_addr)) {
 	die("$argv[1]: Nieznana architektura \"$arch_name\"\n");
 }
-else $arch_id = $arch[$arch_name];
+else $arch_id = $reverse_addr[$arch_name];
 
 $result_name = $matches[2];
 if (!array_key_exists($result_name, $result)) {

================================================================
Index: PLD-doc/PLD_www_res/buildlogs.sql/index.php
diff -u PLD-doc/PLD_www_res/buildlogs.sql/index.php:1.6 PLD-doc/PLD_www_res/buildlogs.sql/index.php:1.7
--- PLD-doc/PLD_www_res/buildlogs.sql/index.php:1.6	Tue Nov 27 10:12:54 2007
+++ PLD-doc/PLD_www_res/buildlogs.sql/index.php	Wed Nov 28 13:42:52 2007
@@ -2,8 +2,10 @@
 ob_start("ob_gzhandler", 1);
 $buildlogs_server = "buildlogs.pld-linux.org";
 $url = "index.php";
+$fail_or_ok = array( "FAIL", "OK" );
+/*
 $addr = array(
-	"", /* must be first */
+	"",
 	"th/SRPMS",
 	"th/i486",
 	"th/i686",
@@ -22,22 +24,12 @@
 	"ac/alpha",	
 	"ac/ppc",
 	"ac/sparc",
-	"ac/sparc64"/*,
-	"/ra/i386",
-	"/ra/i586",
-	"/ra/i686",
-	"/ra/alpha",	
-	"/ra/ppc",
-	"/ra/sparc",
-	"/nest/i486",
-	"/nest/i686",
-	"/nest/alpha",
-	"/nest/ppc"
-*/
+	"ac/sparc64",
 );
-$fail_or_ok = array( "FAIL", "OK" );
+*/
+/*
 $qa_addr = array(
-	"", /* must be first */
+	"",
 	"http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-SRPMS.txt",
 	"http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i486.txt",
 	"http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i686.txt",
@@ -57,25 +49,15 @@
 	"http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
 	"http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
 	"http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc64.txt"/*,
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i386.txt",
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i586.txt",
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/liniowiec/rpmqa-ra-i686.txt",
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/fly/rpmqa-ra-alpha.txt",	
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/an2/rpmqa-ra-ppc.txt",
-	"http://ftp.pld-linux.org/dists/ra/.stat/builder/ares/rpmqa-ra-sparc.txt",
-	"http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i486.txt",
-	"http://ftp.nest.pld-linux.org/.stat/builder/kenny/rpmqa-nest-i686.txt",
-	"http://ftp.nest.pld-linux.org/.stat/builder/alpha/rpmqa-nest-alpha.txt",
-	"http://ftp.nest.pld-linux.org/.stat/builder/an2/rpmqa-nest-ppc.txt"
-*/
 );
 $database = 'sqlite:/home/services/ftp/buildlogs.db';
+$root_directory = "/home/services/ftp/pub/pld-buildlogs";
+*/
 
 $local = 1; /* $local=0 for FTP */ 
-$root_directory = "/home/services/ftp/pub/pld-buildlogs";
 
-// $database and $root_directory are taken from buildlogs.inc
-include_once('buildlogs.inc');
+// $database, $root_directory and others are taken from buildlogs.inc
+include('buildlogs.inc');
 
 $ftp_conn = 0;
 /* It should be set */
@@ -111,18 +93,10 @@
 textdomain("messages");
 
 if (isset($_GET["idx"]))$idx=(int)$_GET["idx"];
-if (isset($_GET["dist"]))
+if (isset($_GET["dist"]) && isset($_GET["arch"]))
 {
-	$dist=$_GET["dist"];
-	if (isset($_GET["arch"]))
-	{
-		$arch=$_GET["arch"];
-		for ($i = 1; $i < count($addr); $i++)
-		{
-			if ($addr[$i]==$dist."/".$arch)
-				$idx=$i;
-		}
-	}
+	$i = $_GET["dist"] . "/" . $_GET["arch"];
+	$idx = (int)$reverse_addr["$i"];
 }
 if (isset($_GET["ok"]))$ok=(int)$_GET["ok"];
 else $ok="";
@@ -138,7 +112,7 @@
 if (isset($_GET["log"]))$log=(int)$_GET["log"];
 
 if (isset($_POST["str"]))$str=$_POST["str"];
-if (isset($_POST["idx"]))$idx=$_POST["idx"];
+if (isset($_POST["idx"]))$idx=(int)$_POST["idx"];
 if (isset($_POST["action"]))$action=$_POST["action"];
 
 function myheader()

================================================================
Index: PLD-doc/PLD_www_res/buildlogs.sql/migration.php
diff -u PLD-doc/PLD_www_res/buildlogs.sql/migration.php:1.3 PLD-doc/PLD_www_res/buildlogs.sql/migration.php:1.4
--- PLD-doc/PLD_www_res/buildlogs.sql/migration.php:1.3	Sat Nov 24 12:10:25 2007
+++ PLD-doc/PLD_www_res/buildlogs.sql/migration.php	Wed Nov 28 13:42:52 2007
@@ -1,20 +1,11 @@
 #!/usr/bin/php.cli
 <?php
 // $Revision$, $Date$
+/*
 $root_directory = '/home/services/ftp/pub/pld-buildlogs';
 $database = 'sqlite:/home/services/ftp/buildlogs.db';
 // $root_directory and $database are taken from buildlogs.inc
-include_once('buildlogs.inc');
-
-$query = " CREATE TABLE LOGS(log_id INTEGER PRIMARY KEY, arch_id INTEGER, result INTEGER, size INTEGER, mtime INTEGER, spec TEXT);";
-try {
-	$dbhandle = new PDO("$database");
-} catch (PDOException $e) {
-	die("new PDO: ". $e->getMessage());
-}
-
-$result = array("FAIL" => 0, "OK" => 1);
-$arch = array(
+$reverse_addr = array(
 	"th/SRPMS" => 1,
 	"th/i486" => 2,
 	"th/i686" => 3,
@@ -35,6 +26,17 @@
 	"ac/sparc" => 18,
 	"ac/sparc64" => 19
 );
+*/
+include('buildlogs.inc');
+
+$query = " CREATE TABLE LOGS(log_id INTEGER PRIMARY KEY, arch_id INTEGER, result INTEGER, size INTEGER, mtime INTEGER, spec TEXT);";
+try {
+	$dbhandle = new PDO("$database");
+} catch (PDOException $e) {
+	die("new PDO: ". $e->getMessage());
+}
+
+$result = array("FAIL" => 0, "OK" => 1);
 
 $list1 = `find $root_directory/th $root_directory/ac -name '*.bz2'`;
 $lista = explode("\n", rtrim($list1));
@@ -43,8 +45,8 @@
 	preg_match("|$root_directory/(.*/.*)/(.*)/(.*)\.bz2|", $file, $matches);
 
 	$arch_name = $matches[1];
-	if (!array_key_exists($arch_name, $arch)) continue;
-	else $arch_id = $arch[$arch_name];
+	if (!array_key_exists($arch_name, $reverse_addr)) continue;
+	else $arch_id = $reverse_addr[$arch_name];
 
 	$result_name = $matches[2];
 	if (!array_key_exists($result_name, $result)) continue;

================================================================
Index: PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO
diff -u PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO:1.2 PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO:1.3
--- PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO:1.2	Sun Nov 18 11:02:07 2007
+++ PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO	Wed Nov 28 13:42:52 2007
@@ -22,6 +22,10 @@
 Skrypty index.php, addlog.php i migration.php używają zmiennej $database.
 Zmienna ta powinna być jednakowa we wszystkich trzech skryptach.
 Jej obecna wartość to 'sqlite:/home/services/ftp/buildlogs.db'.
-Należy ją ustawić na taką wartość, by plik bazy był zapisywalny
-przez skrypty migration.php i addlog.php oraz możliwy do odczytania przez
+Należy ją ustawić na taką wartość, by plik bazy i katalog, w którym się on znajduje
+był zapisywalny przez skrypty migration.php i addlog.php oraz możliwy do odczytania przez
 index.php.
+
+Konfiguracja skryptów jest zapisana w pliku buildlogs.inc.
+Po każdej zmianie w tym pliku należy się upewnić, czy numerki się zgadzają
+i przebudować bazę uruchamiając migration.php.

================================================================
Index: PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc
diff -u PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc:1.1 PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc:1.2
--- PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc:1.1	Sat Nov 24 12:10:18 2007
+++ PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc	Wed Nov 28 13:42:52 2007
@@ -1,4 +1,75 @@
 <?php
 $database = 'sqlite:/home/services/ftp/buildlogs.db';
 $root_directory = "/home/services/ftp/pub/pld-buildlogs";
+$addr = array(
+	0 => "", /* must be first */
+	1 => "th/SRPMS",
+	2 => "th/i486",
+	3 => "th/i686",
+	4 => "th/athlon",
+	5 => "th/x86_64",
+	6 => "th/amd64",
+	7 => "th/ia64",
+	8 => "th/alpha",	
+	9 => "th/ppc",
+	10 => "th/sparc",
+	11 => "ac/SRPMS",
+	12 => "ac/i386",
+	13 => "ac/i586",
+	14 => "ac/i686",
+	15 => "ac/athlon",
+	16 => "ac/amd64",
+	17 => "ac/alpha",	
+	18 => "ac/ppc",
+	19 => "ac/sparc",
+	20 => "ac/sparc64"
+);
+
+$qa_addr = array(
+	0 => "", /* must be first */
+	1 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-SRPMS.txt",
+	2 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i486.txt",
+	3 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-i686.txt",
+	4 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-athlon.txt",
+	5 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-x86_64.txt",
+	6 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-amd64.txt",
+	7 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ia64.txt",
+	8 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-alpha.txt",	
+	9 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-ppc.txt",
+	10 => "http://ftp.pld-linux.org/dists/th/.stat/builder/th/rpmqa-sparc.txt",
+	11 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-SRPMS.txt",
+	12 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i386.txt",
+	13 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i586.txt",
+	14 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-i686.txt",
+	15 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-athlon.txt",
+	16 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-amd64.txt",
+	17 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-alpha.txt",	
+	18 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-ppc.txt",
+	19 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc.txt",
+	20 => "http://ftp.pld-linux.org/dists/ac/.stat/builder/ac/rpmqa-sparc64.txt"
+);
+
+$reverse_addr = array(
+	"th/SRPMS" => 1,
+	"th/i486" => 2,
+	"th/i686" => 3,
+	"th/athlon" => 4,
+	"th/x86_64" => 5,
+	"th/amd64" => 6,
+	"th/ia64" => 7,
+	"th/alpha" => 8,
+	"th/ppc" => 9,
+	"th/sparc" => 10,
+	"ac/SRPMS" => 11,
+	"ac/i386" => 12,
+	"ac/i586" => 13,
+	"ac/i686" => 14,
+	"ac/athlon" => 15,
+	"ac/amd64" => 16,
+	"ac/alpha" => 17,
+	"ac/ppc" => 18,
+	"ac/sparc" => 19,
+	"ac/sparc64" => 20
+);
+
 ?>
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/PLD-doc/PLD_www_res/buildlogs.sql/addlog.php?r1=1.5&r2=1.6&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/PLD-doc/PLD_www_res/buildlogs.sql/index.php?r1=1.6&r2=1.7&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/PLD-doc/PLD_www_res/buildlogs.sql/migration.php?r1=1.3&r2=1.4&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/PLD-doc/PLD_www_res/buildlogs.sql/PRZECZYTAJ.TO?r1=1.2&r2=1.3&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/PLD-doc/PLD_www_res/buildlogs.sql/buildlogs.inc?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list