Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql.php
diff options
context:
space:
mode:
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`" .
+ ")" .
+ ")" .
+ ")";
+}