From 1e2562563ad2d7dd1c3c6be6d80d0241ea330e97 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 20 May 2023 19:05:14 +0200 Subject: mysql_package_version_query new --- lib/mysql-functions | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'lib/mysql-functions') 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 -- cgit v1.2.3-70-g09d2