From 73fc55484007bee8af56e84ceb5562ed3852e5e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josu=C3=A9=20Tille?= Date: Fri, 5 Apr 2024 20:41:41 +0200 Subject: [PATCH] Remove optional flag wait-dpkg-free --- helpers/apt | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/helpers/apt b/helpers/apt index 979e71fa7..5ce94e26c 100644 --- a/helpers/apt +++ b/helpers/apt @@ -45,25 +45,19 @@ ynh_wait_dpkg_free() { # # example: ynh_package_is_installed --package=yunohost && echo "installed" # -# usage: ynh_package_is_installed --package=name [--wait_dpkg_free] -# | arg: -p, --package= - the package name to check -# | arg: -l, --wait_dpkg_free= - wait for dpkg to be free. -# | Note that waiting on dpkg free could take about 0.2s on quick platform -# | and about 2 seconds on slow platform so in case of multiple call it could be slow +# usage: ynh_package_is_installed --package=name +# | arg: -p, --package= - the package name to check # | ret: 0 if the package is installed, 1 else. +# +# Requires YunoHost version 2.2.4 or higher. ynh_package_is_installed() { # Declare an array to define the options of this helper. - local legacy_args=pl - local -A args_array=([p]=package= [l]=wait_dpkg_free=) + local legacy_args=p + local -A args_array=([p]=package=) local package - local wait_dpkg_free # Manage arguments with getopts ynh_handle_getopts_args "$@" - wait_dpkg_free="${wait_dpkg_free:-0}" - if [ "$wait_dpkg_free" -eq 1 ]; then - ynh_wait_dpkg_free - fi dpkg-query --show --showformat='${Status}' "$package" 2>/dev/null \ | grep --count "ok installed" &>/dev/null }