diff options
author | Erich Eckner <git@eckner.net> | 2019-01-20 20:04:33 +0100 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2019-01-20 20:04:58 +0100 |
commit | fb9f877ce42a69f8f36b2251e0726ea59d238220 (patch) | |
tree | 1e23d73eb6e7653840443b5b39af1d1777817aef | |
parent | 8edcb155d057378cefcf830b862f4619a1764cef (diff) | |
download | archweb32-fb9f877ce42a69f8f36b2251e0726ea59d238220.tar.xz |
lib/mysql.php: mysql_query_package_version() new
-rw-r--r-- | lib/mysql.php | 23 |
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`" . + ")" . + ")" . + ")"; +} |