diff --git a/data/helpers.d/package b/data/helpers.d/package index 3ac93a9db..22adb9b15 100644 --- a/data/helpers.d/package +++ b/data/helpers.d/package @@ -2,8 +2,8 @@ # # [internal] # -# usage: ynh_is_dpkg_free -ynh_is_dpkg_free() { +# usage: ynh_wait_dpkg_free +ynh_wait_dpkg_free() { local try # With seq 1 17, timeout will be almost 30 minutes for try in `seq 1 17` @@ -28,7 +28,7 @@ ynh_is_dpkg_free() { # usage: ynh_package_is_installed name # | arg: name - the package name to check ynh_package_is_installed() { - ynh_is_dpkg_free + ynh_wait_dpkg_free dpkg-query -W -f '${Status}' "$1" 2>/dev/null \ | grep -c "ok installed" &>/dev/null } @@ -54,7 +54,7 @@ ynh_package_version() { # # usage: ynh_apt update ynh_apt() { - ynh_is_dpkg_free + ynh_wait_dpkg_free DEBIAN_FRONTEND=noninteractive sudo apt-get -y $@ } @@ -130,7 +130,7 @@ ynh_package_install_from_equivs () { # Create a fake deb package with equivs-build and the given control file # Install the fake package without its dependencies with dpkg # Install missing dependencies with ynh_package_install - ynh_is_dpkg_free + ynh_wait_dpkg_free (cp "$controlfile" "${TMPDIR}/control" && cd "$TMPDIR" \ && equivs-build ./control 1>/dev/null \ && sudo dpkg --force-depends \