Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib/mysql-functions
diff options
context:
space:
mode:
Diffstat (limited to 'lib/mysql-functions')
-rwxr-xr-xlib/mysql-functions12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/mysql-functions b/lib/mysql-functions
index 9cf36fe..9be8521 100755
--- a/lib/mysql-functions
+++ b/lib/mysql-functions
@@ -1276,6 +1276,18 @@ mysql_query_select_pkgbase_and_revision() {
mysql_join_package_sources_upstream_repositories
}
+# mysql_package_version_query [binary_packages]
+# print a mysql query of the full version of a package
+
+mysql_package_version_query() {
+ local bp_name="${1:-binary_packages}"
+ printf 'CONCAT('
+ printf 'IF(`%s`.`epoch`=0,"",CONCAT(`%s`.`epoch`,":")),' "${bp_name}" "${bp_name}"
+ printf '`%s`.`pkgver`,"-",' "${bp_name}"
+ printf '`%s`.`pkgrel`,' "${bp_name}"
+ printf ')'
+}
+
# mysql_package_name_query [binary_packages] [architectures] [compressions]
# print a mysql query of the full name of a package file