Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2023-05-20 19:05:14 +0200
committerErich Eckner <git@eckner.net>2023-05-20 19:05:14 +0200
commit1e2562563ad2d7dd1c3c6be6d80d0241ea330e97 (patch)
tree921d1dbf01763fdb886928b780935890c81fd451 /lib
parentd9a8257a0275f24f93e6f21e6001fc19fbf448bd (diff)
mysql_package_version_query new
Diffstat (limited to 'lib')
-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