summaryrefslogtreecommitdiff
path: root/lib/mysql.php
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-01-20 20:04:33 +0100
committerErich Eckner <git@eckner.net>2019-01-20 20:04:58 +0100
commitfb9f877ce42a69f8f36b2251e0726ea59d238220 (patch)
tree1e23d73eb6e7653840443b5b39af1d1777817aef /lib/mysql.php
parent8edcb155d057378cefcf830b862f4619a1764cef (diff)
downloadarchweb32-fb9f877ce42a69f8f36b2251e0726ea59d238220.tar.xz
lib/mysql.php: mysql_query_package_version() new
Diffstat (limited to 'lib/mysql.php')
-rw-r--r--lib/mysql.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/mysql.php b/lib/mysql.php
index 33ab4f0..19d0dae 100644
--- a/lib/mysql.php
+++ b/lib/mysql.php
@@ -65,3 +65,26 @@ function mysql_url_encode($input) {
return
"REPLACE(" . $input . ",\"+\",\"%2B\")";
}
+
+function mysql_query_package_version($table) {
+ return
+ "CONCAT(" .
+ "IF(" .
+ "`" .$table . "`.`epoch`=\"0\"," .
+ "\"\"," .
+ "CONCAT(" .
+ "`" . $table . "`.`epoch`," .
+ "\":\"" .
+ ")" .
+ ")," .
+ "`" . $table . "`.`pkgver`,\"-\"," .
+ "`" . $table . "`.`pkgrel`," .
+ "IF(`" . $table . "`.`sub_pkgrel_omitted`," .
+ "\"\"," .
+ "CONCAT(" .
+ "\".\"," .
+ "`" . $table . "`.`sub_pkgrel`" .
+ ")" .
+ ")" .
+ ")";
+}