Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-03 09:35:31 +0100
committerErich Eckner <git@eckner.net>2019-01-03 09:35:31 +0100
commit76439c3e010d651eefbfc48f06994b0ed890dd11 (patch)
tree455f8aae280d6023ed7d976e6f1df704270d6812
parentd84b9b4752c970247bddbcd48243739c4a67e946 (diff)
packages/index.php: correctly handle $repo_arch, make paths similar to mirror layout: $repo_arch/$repo/$pkgname
-rw-r--r--packages/index.php22
1 files changed, 13 insertions, 9 deletions
diff --git a/packages/index.php b/packages/index.php
index bb0aa94..d712423 100644
--- a/packages/index.php
+++ b/packages/index.php
@@ -16,6 +16,7 @@ require_once BASE . "/lib/format.php";
"title" => "CPU architecture",
"label" => "Arch",
"table" => "architectures",
+ "column" => "`architectures`.`name`",
"extra_condition" => "",
"values" => array()
),
@@ -24,14 +25,15 @@ require_once BASE . "/lib/format.php";
"title" => "respository",
"label" => "Repository",
"table" => "repositories",
- "extra_condition" => " WHERE `repositories`.`is_on_master_mirror`",
+ "column" => "CONCAT(`architectures`.`name`,\"/\",`repositories`.`name`)",
+ "extra_condition" => mysql_join_repositories_architectures() . " WHERE `repositories`.`is_on_master_mirror`",
"values" => array()
)
);
foreach ( $multi_select_search_criteria as $criterium => $content ) {
$result = mysql_run_query(
- "SELECT `name` FROM `" . $content["table"] . "`" . $content["extra_condition"] . " ORDER BY `name`"
+ "SELECT " . $content["column"] . " AS `name` FROM `" . $content["table"] . "`" . $content["extra_condition"] . " ORDER BY `name`"
);
while ($row = $result -> fetch_assoc())
$multi_select_search_criteria[$criterium]["values"][] = $row["name"];
@@ -45,9 +47,9 @@ require_once BASE . "/lib/format.php";
$filter = " WHERE 1";
foreach ($multi_select_search_criteria as $criterium)
if (isset($_GET[$criterium["name"]])) {
- $filter .= " AND `" . $criterium["table"] . "`.`name` IN (";
+ $filter .= " AND " . $criterium["column"] . " IN (";
foreach ($criterium["values"] as $value)
- if (strpos("&" . $_SERVER["QUERY_STRING"] . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
+ if (strpos("&" . urldecode($_SERVER["QUERY_STRING"]) . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
$filter .= "\"" . $value . "\",";
$filter .= "\"\")";
}
@@ -113,6 +115,7 @@ require_once BASE . "/lib/format.php";
mysql_join_binary_packages_binary_packages_in_repositories() .
mysql_join_binary_packages_in_repositories_repositories() .
" AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures("","r_a") .
mysql_join_binary_packages_build_assignments() .
mysql_join_build_assignments_package_sources() .
$filter . $exact_filter .
@@ -124,7 +127,7 @@ require_once BASE . "/lib/format.php";
"SELECT " .
"`binary_packages`.`pkgname`," .
"`package_sources`.`pkgbase`," .
- "`repositories`.`name` AS `repo`," .
+ "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`) AS `repo`," .
"`architectures`.`name` AS `arch`," .
"CONCAT(IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," .
"`binary_packages`.`pkgver`,\"-\"," .
@@ -152,7 +155,7 @@ require_once BASE . "/lib/format.php";
"repo" => array(
"title" => "repository",
"label" => "Repo",
- "mysql" => "`repositories`.`name`"
+ "mysql" => "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`)"
),
"pkgname" => array(
"title" => "package name",
@@ -191,6 +194,7 @@ require_once BASE . "/lib/format.php";
mysql_join_binary_packages_binary_packages_in_repositories() .
mysql_join_binary_packages_in_repositories_repositories() .
" AND `repositories`.`is_on_master_mirror`" .
+ mysql_join_repositories_architectures("","r_a") .
mysql_join_binary_packages_build_assignments() .
mysql_join_build_assignments_package_sources() .
$filter . $fuzzy_filter .
@@ -220,7 +224,7 @@ require_once BASE . "/lib/format.php";
"SELECT " .
"`binary_packages`.`pkgname`," .
"`package_sources`.`pkgbase`," .
- "`repositories`.`name` AS `repo`," .
+ "CONCAT(`r_a`.`name`,\"/\",`repositories`.`name`) AS `repo`," .
"`architectures`.`name` AS `arch`," .
"CONCAT(IF(`binary_packages`.`epoch`=\"0\",\"\",CONCAT(`binary_packages`.`epoch`,\":\"))," .
"`binary_packages`.`pkgver`,\"-\"," .
@@ -251,7 +255,7 @@ require_once BASE . "/lib/format.php";
print " " . $row["repo"] . "\n";
print " </td>\n";
print " <td>\n";
- print " <a href=\"/" . $row["repo"] . "/" . $row["arch"] . "/" . $row["pkgname"] ."/\" ";
+ print " <a href=\"/" . $row["repo"] . "/" . $row["pkgname"] ."/\" ";
print "title=\"View package details for " . $row["pkgname"] . "\">" . $row["pkgname"] . "</a>\n";
print " </td>\n";
print " <td>\n";
@@ -391,7 +395,7 @@ require_once BASE . "/lib/format.php";
print " <select multiple=\"multiple\" id=\"id_" . $criterium["name"] . "\" name=\"" . $criterium["name"] . "\">\n";
foreach ($criterium["values"] as $value) {
print " <option value=\"" . $value . "\"";
- if (strpos( "&" . $_SERVER["QUERY_STRING"] . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
+ if (strpos( "&" . urldecode($_SERVER["QUERY_STRING"]) . "&", "&" . $criterium["name"] . "=" . $value . "&") !== false)
print " selected=\"selected\"";
print ">" . $value . "</option>\n";
}