index : builder | |
Archlinux32 build system | gitolite user |
summaryrefslogtreecommitdiff |
author | Erich Eckner <git@eckner.net> | 2018-09-03 14:18:01 +0200 |
---|---|---|
committer | Erich Eckner <git@eckner.net> | 2018-09-03 14:18:01 +0200 |
commit | 385150b196c418d3056e02bf9a0f22a2f383bff7 (patch) | |
tree | 8be2ce8ccfe00ed2feb34b3c57847179ce0ac649 /lib/mysql-functions | |
parent | a4938cc0a9594028d117b970ce973155444ff565 (diff) |
-rwxr-xr-x | lib/mysql-functions | 29 |
diff --git a/lib/mysql-functions b/lib/mysql-functions index 8cdafad..6c8154c 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -1257,3 +1257,32 @@ mysql_sort_versions() { mysql_run_query ) } + +# mysql_load_min_and_max_versions +# load the minimal and maximal versions into min_version and max_version + +mysql_load_min_and_max_versions() { + if [ -z "${min_version}" ]; then + min_version=$( + { + printf 'SELECT CONCAT(`versions`.`epoch`,":",`versions`.`version`)' + printf ' FROM `versions`' + printf ' ORDER BY `versions`.`order`' + printf ' LIMIT 1' + } | \ + mysql_run_query + ) + fi + + if [ -z "${max_version}" ]; then + max_version=$( + { + printf 'SELECT CONCAT(`versions`.`epoch`,":",`versions`.`version`)' + printf ' FROM `versions`' + printf ' ORDER BY `versions`.`order` DESC' + printf ' LIMIT 1' + } | \ + mysql_run_query + ) + fi +} |