diff options
Diffstat (limited to 'satellit_installer')
-rw-r--r-- | satellit_installer/includes/10-install_packages.inc | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/satellit_installer/includes/10-install_packages.inc b/satellit_installer/includes/10-install_packages.inc index 66edbb3..0d96cfa 100644 --- a/satellit_installer/includes/10-install_packages.inc +++ b/satellit_installer/includes/10-install_packages.inc @@ -1,24 +1,20 @@ #!/bin/bash install_package() { - # These stacked ifs are just a stopgap until proper trapping. - local PACKAGE="$1" - echo "# Installing package $PACKAGE... " - apt-get $INSTALLOPTIONS install "${PACKAGE}" && return 0 + echo "# Installing packages $* ... " + apt-get $INSTALLOPTIONS install "$@" && return 0 echo - echo "# Could not install package $PACKAGE - Error number $ERR!" + echo "# Could not install $*" echo "# Trying an apt-get update..." if ! apt-get update; then - echo perror "apt-get update failed. Abort." fi - echo "# Retrying installing package $PACKAGE... " - apt-get $INSTALLOPTIONS install "${PACKAGE}" && return 0 - perror "Could not install $PACKAGE. Giving up." + echo "# Retrying installing package $* ... " + apt-get $INSTALLOPTIONS install "$@" && return 0 + perror "Could not install $* - Giving up." } install_packages() { - local PACKAGE local NEEDED_PACKAGES="$2" local INSTALLOPTIONS= @@ -32,9 +28,7 @@ install_packages() { RECOM) INSTALLOPTIONS="-qq -y" ;; esac - for PACKAGE in $NEEDED_PACKAGES; do - install_package "$PACKAGE" - done + install_package $NEEDED_PACKAGES # No quotes } # install_files <module_name> |