Skip to content

Commit

Permalink
install_deps: upgrade only specified packages, not full system
Browse files Browse the repository at this point in the history
Change `install_deps.sh` script behaviour to only upgrade specified packages instead of all installed packages. Full system upgrade is not necessary and can even be dangerous (see PR for more details)
  • Loading branch information
theblackhole authored Feb 3, 2024
1 parent d44a77b commit bdb59f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,13 @@ PM_INSTALL_MAP["apt-get"]="install -y"
PM_INSTALL_MAP["apk"]="add"

declare -A PM_UPGRADE_MAP
PM_UPGRADE_MAP["apt-get"]="upgrade -y"
PM_UPGRADE_MAP["apt-get"]="install -y"
PM_UPGRADE_MAP["zypper"]="up -y"

declare -A PM_SYSTEM_UPGRADE_MAP
PM_SYSTEM_UPGRADE_MAP["apt-get"]="upgrade"
PM_SYSTEM_UPGRADE_MAP["zypper"]="up"

check_package_manager() {
for f in "${!os_pm_install[@]}"; do
if [[ -f $f ]]; then
Expand All @@ -97,6 +101,8 @@ check_package_manager() {
unset 'INSTALL_OPTION[-1]'
readarray -td ' ' UPGRADE_OPTION <<<"${PM_UPGRADE_MAP[$PM]} "
unset 'UPGRADE_OPTION[-1]'
readarray -td ' ' SYSTEM_UPGRADE_OPTION <<<"${PM_SYSTEM_UPGRADE_MAP[$PM]} "
unset 'SYSTEM_UPGRADE_OPTION[-1]'
fi
}

Expand Down

0 comments on commit bdb59f4

Please sign in to comment.