From f78c68db27a360493e729c64db7bcf06863fee6c Mon Sep 17 00:00:00 2001 From: Dimitry Ishenko Date: Sat, 14 Dec 2024 16:26:43 -0500 Subject: [PATCH] interface_package: add pkg_configure and pkg_full_upgrade --- tools/modules/functions/interface_package.sh | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tools/modules/functions/interface_package.sh b/tools/modules/functions/interface_package.sh index 100b5493..26d583a6 100644 --- a/tools/modules/functions/interface_package.sh +++ b/tools/modules/functions/interface_package.sh @@ -4,6 +4,32 @@ _pkg_have_stdin() { [[ -t 0 ]] } declare -A module_options +module_options+=( + ["pkg_configure,author"]="@dimitry-ishenko" + ["pkg_configure,desc"]="Configure an unconfigured package" + ["pkg_configure,example"]="pkg_configure" + ["pkg_configure,feature"]="pkg_configure" + ["pkg_configure,status"]="Interface" +) + +pkg_configure() +{ + _pkg_have_stdin && debconf-apt-progress -- dpkg --configure "$@" || dpkg --configure "$@" +} + +module_options+=( + ["pkg_full_upgrade,author"]="@dimitry-ishenko" + ["pkg_full_upgrade,desc"]="Upgrade installed packages (potentially removing some)" + ["pkg_full_upgrade,example"]="pkg_full_upgrade" + ["pkg_full_upgrade,feature"]="pkg_full_upgrade" + ["pkg_full_upgrade,status"]="Interface" +) + +pkg_full_upgrade() +{ + _pkg_have_stdin && debconf-apt-progress -- apt-get -y full-upgrade "$@" || apt-get -y full-upgrade "$@" +} + module_options+=( ["pkg_install,author"]="@dimitry-ishenko" ["pkg_install,desc"]="Install package"