From 8af016645fee5c0b22e69d46de9b3401c1bc82d3 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Tue, 17 Apr 2018 09:36:08 +0200 Subject: lib/ new --- buildmaster/build-list.php | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'buildmaster') diff --git a/buildmaster/build-list.php b/buildmaster/build-list.php index d576019..966c5b5 100644 --- a/buildmaster/build-list.php +++ b/buildmaster/build-list.php @@ -1,7 +1,7 @@ - - List of " . $to_show . " package builds\n"; -print "\n"; -print "\n"; -print "\n"; -print "Start page\n"; -print "build logs
\n"; + die_500("Unknown parameter for \"show\"."); -$mysql = new mysqli("localhost", "webserver", "empty", "buildmaster"); -if ($mysql->connect_error) { - die("Connection failed: " . $mysql->connect_error); -} - -$result = $mysql -> query( +$result = mysql_run_query( "SELECT DISTINCT " . "`build_assignments`.`id`," . "`build_assignments`.`is_blocked`," . @@ -65,6 +53,7 @@ $result = $mysql -> query( "LEFT JOIN `build_slaves` ON `build_slaves`.`currently_building`=`build_assignments`.`id` " . "WHERE `repositories`.`name`=\"build-list\"" . $match ); + if ($result -> num_rows > 0) { $count = 0; @@ -76,7 +65,7 @@ if ($result -> num_rows > 0) { ($row["dependencies_pending"]==1)) continue; - $fail_result = $mysql -> query( + $fail_result = mysql_run_query( "SELECT " . "`fail_reasons`.`name`, " . "`failed_builds`.`log_file` " . @@ -167,6 +156,22 @@ if ($result -> num_rows > 0) { $count++; } +} + +?> + + +List of " . $to_show . " package builds\n"; +print "\n"; +print "\n"; +print "\n"; +print "Start page\n"; +print "build logs
\n"; + +if ($count > 0) { + usort( $rows, function (array $a, array $b) { -- cgit v1.2.3