From c9c761f526a377988dd90f7e6339b5e9f4b43a14 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Wed, 23 Jan 2019 09:48:33 +0100 Subject: buildmaster/index.php: show multiple arches at once (e.g. by default display i686 and any) --- buildmaster/index.php | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'buildmaster') diff --git a/buildmaster/index.php b/buildmaster/index.php index 47e1e1c..0ea0376 100644 --- a/buildmaster/index.php +++ b/buildmaster/index.php @@ -2,36 +2,38 @@ require_once "../init.php"; require_once BASE . "/lib/mysql.php"; -if (!array_key_exists("arch",$_GET)) - $_GET["arch"]="i686"; +if (array_key_exists("arch",$_GET)) { + $archs = array(); + foreach (explode("&",$_SERVER["QUERY_STRING"]) as $param) { + if (strpos($param,"arch=")!==0) + continue; + $param = substr($param,5); + if ($param == "") + continue; + $archs[$param] = $param; + } + if (count($archs)==0) { + $archs = array("i486" => "i486", "i686" => "i686", "any" => "any"); + } +} else { + $archs = array("i686" => "i686", "any" => "any"); +} -$arch = $_GET["arch"]; -switch ($arch) { - case "any": - $title = "architecture independent packages"; - break; - case "i486": - $title = "i486"; - break; - case "i686": - $title = "i686"; - break; - default: - $title = "all architectures"; - $arch = ""; +function encode_arch($a) { + return "arch=" . urlencode($a); } -if ($arch != "") { - $sarch_param = "?arch=" . urlencode($arch); - $march_param = "&arch=" . urlencode($arch); -} else { - $sarch_param = ""; - $march_param = ""; + +$sarch_param = implode("&",array_map('encode_arch',$archs)); +$march_param = ""; +if ($sarch_param != "") { + $march_param = "&" . $sarch_param; + $sarch_param = "?" . $sarch_param; } ?> - Buildmaster for Archlinux32 packages (<?php print $title; ?>) + Buildmaster for Archlinux32 packages (<?php print implode(", ",$archs); ?>) @@ -58,8 +60,6 @@ if ($arch != "") { "; switch ($a) { case "": -- cgit v1.2.3-70-g09d2