index : website | |
Archlinux32 website - obsolete | gitolite user |
summaryrefslogtreecommitdiff |
-rw-r--r-- | lib/mysql.php | 23 |
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`" . + ")" . + ")" . + ")"; +} |