summaryrefslogtreecommitdiffstats
path: root/helper
diff options
context:
space:
mode:
authorJonathan Bauer2013-06-12 13:46:38 +0200
committerJonathan Bauer2013-06-12 13:46:38 +0200
commit7ac42fd03f95feee3942e9a54aad64d3e66f904f (patch)
treeeec09da2b759f5399e1a6533e0cd107ecffffb14 /helper
parent[fileutil.inc] generic install_package function, to be used in scripts. Insta... (diff)
downloadtm-scripts-7ac42fd03f95feee3942e9a54aad64d3e66f904f.tar.gz
tm-scripts-7ac42fd03f95feee3942e9a54aad64d3e66f904f.tar.xz
tm-scripts-7ac42fd03f95feee3942e9a54aad64d3e66f904f.zip
[fileutil.inc] minor fix
Diffstat (limited to 'helper')
-rw-r--r--helper/fileutil.inc11
1 files changed, 6 insertions, 5 deletions
diff --git a/helper/fileutil.inc b/helper/fileutil.inc
index d4965b5b..9a3c5aff 100644
--- a/helper/fileutil.inc
+++ b/helper/fileutil.inc
@@ -83,12 +83,13 @@ install_packages() {
pdebug "ARGS: $@"
local PACKAGE_LIST="$@"
if [ "x$PACKET_MANAGER" == "xapt" ]; then
- apt-get install -y ${PACKAGE_LIST}
- local IRET="$?"
- [ "x$IRET" != "x0" ] && pwarning "install_package: apt-get failed with '$IRET' for package '$PACKAGE_LIST'"
+ apt-get install -y ${PACKAGE_LIST} || \
+ pwarning "install_package: apt-get failed with '$IRET' for package '$PACKAGE_LIST'"
elif [ "x$PACKET_MANAGER" == "xzypper" ]; then
- local IRET=$(zypper --no-refresh --non-interactive install ${PACKAGE_LIST})
- [ "x$IRET" != "x0" ] && pwarning "install_package: zypper failed with '$IRET' for package '$PACKAGE_LIST'"
+ zypper --no-refresh --non-interactive install ${PACKAGE_LIST} || \
+ pwarning "install_package: zypper failed with '$IRET' for package '$PACKAGE_LIST'"
+ else
+ pinfo "No packet manager determined, this should not happen!"
fi
}