summaryrefslogtreecommitdiffstats
path: root/satellit_installer/includes
diff options
context:
space:
mode:
authorSimon Rettberg2020-12-18 14:31:48 +0100
committerSimon Rettberg2020-12-18 14:31:48 +0100
commitc30e0b2e08fa68676133c1c3cea9767bca40ca70 (patch)
tree1887993947040083fa11b17cc67312a900fd7c81 /satellit_installer/includes
parent[SSPS] Fix tm-pw-patch, clean up package install (diff)
downloadsetup-scripts-c30e0b2e08fa68676133c1c3cea9767bca40ca70.tar.gz
setup-scripts-c30e0b2e08fa68676133c1c3cea9767bca40ca70.tar.xz
setup-scripts-c30e0b2e08fa68676133c1c3cea9767bca40ca70.zip
[SSPS] Install all packages at once
Diffstat (limited to 'satellit_installer/includes')
-rw-r--r--satellit_installer/includes/10-install_packages.inc20
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>